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

Add Audience as an alias to TenantId. #728

Merged
merged 3 commits into from Jul 12, 2021

Conversation

peombwa
Copy link
Member

@peombwa peombwa commented Jun 29, 2021

This PR closes #497 by:

  • Adding -Audience as an alias to -TenantId. This allows customers to specify the sign-in audience they want to connect to. Also, TenantId and Audience are mutually exclusive and cannot be used together. See https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-client-application-configuration#authority.
  • Updating Invalid_Scope error message by adding Please retry by specifying a sign-in -Audience or -TenantId to Connect-MgGraph. e.g., Connect-MgGraph -Audience 'organizations' -Scopes 'YOUR_SCOPES' -UseDeviceAuthentication. as a suggestion that can be used to resolve the error. When using device code flow, MSAL validates the provided scopes to see if they can be consented to using common audience (default audience). An Invalid_Scope error is thrown if the audience can't consent to the provided scope.
Proposal

image

Ref - https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-aadsts-error-codes#aadsts-error-codes.

@peombwa peombwa self-assigned this Jun 29, 2021
@peombwa peombwa merged commit 5b6a1fe into dev Jul 12, 2021
@peombwa peombwa deleted the enhancements/HandlePermissionErrors branch July 12, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect-MgGraph fails when requesting Policy.ReadWriteApplicationConfiguration scope and some other scopes
2 participants