Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: m365 login doesn't accept short option for secret #4858

Closed
nicodecleyre opened this issue May 10, 2023 · 6 comments
Closed

Bug report: m365 login doesn't accept short option for secret #4858

nicodecleyre opened this issue May 10, 2023 · 6 comments
Assignees
Milestone

Comments

@nicodecleyre
Copy link
Contributor

Priority

(Low) Something is a little off

Description

When using the short option for secret, you get an error message 'Error: 'GUID,secret' is not a valid authentication type'. This is because in the code there is no short option defined for the secret option:

{
option: '--secret [secret]'
},

While in the docs it states that a short option is possible

`-s, --secret [secret]`
: Client Secret of the Azure AD application to use for authentication. Required when `authType` is set to `secret`.

Either we add the short option for secret in the code or we remove the short option in the docs

Steps to reproduce

Execute m365 login --appId [your app id] -s [your secret] --tenant [your tenant id] --authType secret

Expected results

that the command executes with the short options for secret

Actual results

'Error: 'GUID,secret' is not a valid authentication type'.

Diagnostics

No response

CLI for Microsoft 365 version

6.8.0

nodejs version

18.12.1

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

@milanholemans
Copy link
Contributor

Great find @nicodecleyre!
We have 2 choices:

  1. Remove short from the docs
  2. Add short to the code

My gut feeling says we should go for option 2.

@nicodecleyre
Copy link
Contributor Author

My guts feeling says the same, but then my next remark is that the other options you use in conjunction with the secret option don't have a short. More specific appId & tenant.

example:
m365 login --appId [your app id] -s [your secret] --tenant [your tenant id] --t secret

@milanholemans
Copy link
Contributor

In case you authenticate with a certificate, you'll encounter the same because certificateFile has a short -c.

@milanholemans
Copy link
Contributor

Do you want to work on this one?

@nicodecleyre
Copy link
Contributor Author

Do you want to work on this one?

Fine by me 😁. So adding the short to the code is the final verdict?

@milanholemans
Copy link
Contributor

Let's do that yes 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants