-
Notifications
You must be signed in to change notification settings - Fork 378
ImdsV2: Non-mTLS POP Requests Fall Back to ImdsV1 #5531
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
base: rginsburg/msiv2_feature_branch
Are you sure you want to change the base?
ImdsV2: Non-mTLS POP Requests Fall Back to ImdsV1 #5531
Conversation
public static AcquireTokenForManagedIdentityParameterBuilder WithMtlsProofOfPossession( | ||
this AcquireTokenForManagedIdentityParameterBuilder builder) | ||
{ | ||
void MtlsNotSupportedForManagedIdentity(string message) |
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.
This logic was previously in the wrong file
This is because we need Gladwin's big PR around AuthenticationOperation. mtls pop tokens aren't cached properly without it. |
@Robbie-Microsoft I have a PR out that adds the token type and also adds the cert to the auth result. That will unblock you. |
} | ||
|
||
#region Acceptance Tests | ||
#region Bearer Token Tests |
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.
we should not delete these test cases. Is there a way to add a env_variable to enable MSI v2 on-demand and run these? so we are testing the bearer path as we make changes?
request.BodyParameters.Add("grant_type", OAuth2GrantType.ClientCredentials); | ||
request.BodyParameters.Add("scope", resource.TrimEnd('/') + "/.default"); | ||
request.BodyParameters.Add("token_type", tokenType); | ||
request.BodyParameters.Add("token_type", "mtls_pop"); |
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.
Suggest we keep both bearer and mtls_pop for the time being, and we enable MSI v2 bearer based on a feature flag.
string userAssignedId = null, | ||
string certificateRequestCertificate = TestConstants.ValidRawCertificate, | ||
bool mTLSPop = false) | ||
string certificateRequestCertificate = TestConstants.ValidRawCertificate) |
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.
This valid RAW certificate is expired. Can we extend this to 20 years or something?
All existing unit tests pass.
Still requires manual testing.
Currently having a problem in new unit test, where after a bearer token is requested, requesting an mTLS PoP token will return the bearer token from the cache.