I am using Connect-AzAccount
to login with Azure PowerShell. First I am brought to this page with a URL like this. I then select my account and continue. It does not prompt me for my password because of what I assume is SSO.
https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?scope=https%3a%2f%2fmanagement.core.windows.net%2f%2f.default+openid+profile+offline_access&response_type=code&
client_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&
redirect_uri=http%3a%2f%2flocalhost%3a8400%2f&
claims=%7b%22access_tokenXXXXXXXXXXXXXXXXXXXXXXXXvaluesXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&
client-request-id=XXXXXXXXXXXXXXXXXXXXXXX&
x-client-SKU=MSAL.NetCore&
x-client-Ver=4.49.1.0&
x-client-CPU=x64&
x-client-OS=Microsoft+Windows+10.0.22621&
prompt=select_account&
code_challenge=XXXXXXXXXXXXXXXXXXXXX&
code_challenge_method=S256&
state=XXXXXXXXXXXXXXXXXXX&client_info=1&sso_nonce=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX&mscrid=XXXXXXXXXXXXXXXXXXXXXXX&login_hint=MYNAME%40EMAIL.com
Then I brought to this page where I am facing the error.
https://localhost:8400/?code=XXXXXXXXXXX
&client_info=XXXXXX
&state=XXXXXXXXXXXXX
&session_state=XXXXXXXXXXXXX
Need to check below:
Update-Module -Name Az
.redirect_uri
argument in your PowerShell authentication request (http/https
and port number
, if appropriate).Edge
is not working.After checking all the above, I tried connecting to Az
account with the relevant
connect-AzAccount
command and it worked as shown.