Open daviewales opened 1 month ago
Hi @daviewales, sorry to hear that CLI is not working properly for you. Just to fully understand the issue, is this what you did?
m365 cli setup
, choose for existing app registration & interactive scriptingm365 login
This results in an error?
Yes, that's exactly right.
I can get it to work if I use --authType deviceCode
. But I get the error if I use the default browser login.
Priority
(Medium) I'm annoyed but I'll live
Skip to the end for a workaround.
Description
I've setup a new Entra App Registration as described in the docs.
I've then run
m365 setup
, and configured it to use interactive login.When I run
m365 login
, my browser opens a tab at https://login.microsoftonline.com, but I get an error stating that the redirect URI specified in the request does not match the redirect URI configured for the application.Steps to reproduce
I have confirmed that all the app registration configuration settings exactly match the description in the documentation: https://pnp.github.io/cli-microsoft365/user-guide/using-own-identity/#configure-authentication-settings
The platform is Mobile and Desktop Applications.
The redirect URI is set to: https://login.microsoftonline.com/common/oauth2/nativeclient
And Allow Public Client flows is set to 'Yes'.
I have tried selecting a bunch of different options in
m365 setup
, but I always end up in the same place, with the non-matching redirect URI error above.Expected results
I expect the login to succeed.
Actual results
Error:
Diagnostics
CLI for Microsoft 365 version
v9.0.0
nodejs version
bun.sh: 1.1.20
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
Additional Info
Workaround
I can successfully login if I force it to use deviceCode login rather than browser login. This works:
This doesn't work (and is also the default when using
m365 login
):