Skip to content

Conversation

Robbie-Microsoft
Copy link
Contributor

@Robbie-Microsoft Robbie-Microsoft commented Oct 14, 2025

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.

@Robbie-Microsoft Robbie-Microsoft requested a review from a team as a code owner October 14, 2025 19:17
public static AcquireTokenForManagedIdentityParameterBuilder WithMtlsProofOfPossession(
this AcquireTokenForManagedIdentityParameterBuilder builder)
{
void MtlsNotSupportedForManagedIdentity(string message)
Copy link
Contributor Author

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

@Robbie-Microsoft Robbie-Microsoft marked this pull request as draft October 14, 2025 22:08
@bgavrilMS
Copy link
Member

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.

This is because we need Gladwin's big PR around AuthenticationOperation. mtls pop tokens aren't cached properly without it.

@gladjohn
Copy link
Contributor

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.

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
Copy link
Contributor

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");
Copy link
Contributor

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)
Copy link
Contributor

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?

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.

3 participants