Closed sscchh2001 closed 4 years ago
@sscchh2001 , could you share us how you created credential?
@dingmeng-xue , I use
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "UPN", (ConvertTo-SecureString "PASSWORD" -AsPlainText -Force)
in powershell and store it in $profile, so every time I open a new session the $cred variable would be ready for use.
After clearing every context, if I login with Connect-AzAccount -Environment azurechinacloud -Credential $cred -Tenant <tenantID>
, the login would succeed. The account I use has access to multiple tenants and dozens of subscriptions, not sure if this could be the cause.
I tried Az.Accounts 1.9.3 and it can work in my environment. What's value of UPN? Is it a service principle? If you are using a service principle, it is used in a specific tenant. It cannot work if without tenant.
Close this issue after a quick talk. Issue cannot be reproduced in clean environment.
oauthlib.oauth2.rfc6749.errors.InvalidClientIdError: (invalid_request) AADSTS900144: The request body must contain the following parameter: 'refresh_token'. Trace ID: 2bb25225-c720-4c1f-8e92-cd259c282602 Correlation ID: ca536010-2500-4c5e-95f0-ae2ed0044441 Timestamp: 2020-12-16 06:36:08Z
Description
This happens in Azure China environment. When I remove all the existing contexts from PS session, Connect-AzAccount would respond with AADSTS900144: The request body must contain the following parameter: 'password'.
Steps to reproduce
Environment data
Module versions
Debug output
Error output