-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Auth} Clarify Identity class's boundary
#31014
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
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
| def login_in_cloud_shell(self, scopes): | ||
| raise NotImplementedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to remove login_in_cloud_shell Since cloud_shell is a special user identity in msal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with MSAL's design, see #29637 (comment), #29637 (comment) for detailed explanations.
I want to keep the calling pattern for Identity consistent - authority should always be a required parameter.
For Cloud Shell authentication, the CLI command is az login --identity. It is a managed identity credential, no matter what token is returned. Including CloudShellCredential in Identity blurs its boundary.
Related command
az loginDescription
Part of #25959
Identitywill never be used for managed identity authentication, as managed identity inherently differs from user or service principal:authority. Also, because the network request is expensive, a local token cache is used.authorityis required. As IMDS has its own token cache, a local token cache is not necessary.Of course, it is possible to make
authorityoptional andIdentitywork for managed identity, but this requires more effort and blursIdentity's boundary. According to https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow, the public-facing name of eSTS is "Microsoft identity platform", so calling this classIdentityand limit it to user or service principal authentication is accurate and reasonable.This PR clarifies
Identityclass's boundary and deletes unused methods.