-
Notifications
You must be signed in to change notification settings - Fork 3
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 support for Managed Identity #108
Conversation
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.
The design is to have a property of type ManagedIdentityOptions on AcquireTokenOptions, not to change CredentialSource/CredentialDescription
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ApplicationOptions/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
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.
Thanks @JoshLozensky
There are a few things to change, but this looks good already!
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ApplicationOptions/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/CredentialDescriptionTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
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.
@JoshLozensky
this is a really good proposal!
I'm still hesitant about the verbosity. I personally prefer shorter expressions, and a pay as you go approach: I want to use managed identity, but default it's a system assigned one, so I'll just say "Managed identity". then if I've made more effort and created a user-assigned managed identity I know the client ID and I can provide the ID.
For the programmatic approach, static methods:
ManagedIdentityDescription.FromUserAssignedObjectId(string) etc, could also help.
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityDescription.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityDescription.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
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 agree with @jmprieur 's proposals. Will review again once those are taken into consideration.
PS: naming is hard. we had endless discussions about this in MSAL .NET and MSAL JS as well.
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.
LGTM
Thanks @JoshLozensky
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityDescription.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/ManagedIdentityDescriptionTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityType.cs
Show resolved
Hide resolved
are all the usings needed? In reply to: 1835478327 Refers to: src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityType.cs:1 in 11fde20. [](commit_id = 11fde20, deletion_comment = False) |
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityType.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityDescription.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/AquireTokenOptionsTests.cs
Outdated
Show resolved
Hide resolved
d68ac8b
to
e560977
Compare
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
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.
LGTM
Thanks @JoshLozensky
A few more fixes to do (per the compiler)
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityOptions.cs
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/DownstreamApiTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/ManagedIdentity/ManagedIdentityType.cs
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Identity.Abstractions/TokenAcquisition/AcquireTokenOptions.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Identity.Abstractions.Tests/DownstreamApiTests.cs
Outdated
Show resolved
Hide resolved
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.
Approving as @JoshLozensky and I discussed offline on the few remaining comments.
…icrosoft-identity-abstractions-for-dotnet into lozensky/AddMsiSupport
Add support for Managed Identity
Added ManagedIdentity as a CredentialType
Description
Added Managed Identity to the Credential Type, Description, and Source classes. Created a new class ManagedIdentityOptions with the three relevant fields ClientId, ObjectId, and HostResourceId
Fixes #1775 #2551