-
Notifications
You must be signed in to change notification settings - Fork 378
Adding withCertificate overload to use cert serial number #5151
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
src/client/Microsoft.Identity.Client/AppConfig/ConfidentialClientApplicationBuilder.cs
Outdated
Show resolved
Hide resolved
src/client/Microsoft.Identity.Client/AppConfig/ConfidentialClientApplicationBuilder.cs
Outdated
Show resolved
Hide resolved
src/client/Microsoft.Identity.Client/PublicApi/net462/PublicAPI.Unshipped.txt
Show resolved
Hide resolved
tests/Microsoft.Identity.Test.Unit/PublicApiTests/ClientCredentialWithCertTest.cs
Outdated
Show resolved
Hide resolved
tests/Microsoft.Identity.Test.Unit/PublicApiTests/ClientCredentialWithCertTest.cs
Show resolved
Hide resolved
src/client/Microsoft.Identity.Client/AppConfig/ApplicationConfiguration.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.
Please add the following tests,
- Validate Cache Partitioning with Different Certificates
- Verify Token Retrieval from Cache
- Validate Behavior When associateTokensWithCertificateSerialNumber is False
- Ensure Cache Key is Formed Correctly
Would adding an integration test add any value here?
src/client/Microsoft.Identity.Client/AppConfig/ConfidentialClientApplicationBuilder.cs
Outdated
Show resolved
Hide resolved
src/client/Microsoft.Identity.Client/AppConfig/ConfidentialClientApplicationBuilder.cs
Outdated
Show resolved
Hide resolved
src/client/Microsoft.Identity.Client/AppConfig/ConfidentialClientApplicationBuilder.cs
Outdated
Show resolved
Hide resolved
tests/Microsoft.Identity.Test.Unit/PublicApiTests/ClientCredentialWithCertTest.cs
Show resolved
Hide resolved
The underlying api has tests that are already validating cache partitioning/cache key format/token retrieval from cache. This is one of those scenarios where I am trying to decide how much testing should be done if the underlying api ( Seems like an interesting discussion @gladjohn @bgavrilMS However, I agree that I can test the false case for the api. |
Refactoring
Co-authored-by: Gladwin Johnson <[email protected]>
src/client/Microsoft.Identity.Client/AppConfig/ApplicationConfiguration.cs
Outdated
Show resolved
Hide resolved
added negative testing looks good. |
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.
🚢
| <AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> |
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.
@trwalke - please remove this.
Fixes #
#5150
Changes proposed in this request
The new
WithCertificate(X509Certificate2 certificate, bool sendX5C, bool associateTokensWithCertificateSerialNumber)api enables MSAL to add the certificate serial number to the cache key using the new cache key extension.This is certificate serial number is added at the application level and is intended to enable app tokens to be associated with the certificate serial number for every request.
This api internally calls
WithAdditionalCacheKeyComponents(Dict<string, string>)to further partition the cache key by cert serial number.Testing
Unit tests
Manual testing
Performance impact
N/A
Documentation