Skip to content
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

x5t:base64encodedthumbprint and typ:JWT missing in generated client_assertion #9852

Closed
marcerik opened this issue Jun 2, 2021 · 4 comments
Closed
Assignees
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue

Comments

@marcerik
Copy link

marcerik commented Jun 2, 2021

Describe the bug
I use Spring Boot 2.5.0 where Spring Security 5.5.0 is included.

From issue #8175 I read that "partial" support for JWT OAuth 2.0 Client Authentication and Authorization Grant is implemented.

https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#second-case-access-token-request-with-a-certificate

I set up everything in Spring Boot and initiate token access chain.

It seems like Header parameters "x5t:base64EncodedThumprintHere" and "typ:JWT" inside the signed client_assertion are not sent to to the Azure AD at all, only ALG:RS256 is sent in the Header. Claims are created correctly.

During debug I observe that in method "private static JoseHeader addKeyIdentifierHeadersIfNecessary(JoseHeader headers, JWK jwk)" in NimbusJwsEncoder.java neither "x5t:base64thumbprinthere" nor typ:JWT header gets added. On the other hand I am able to get the "x5t#S256" parameter populated, but Azure AD does not accept it.

To Reproduce

Expected behavior
"x5t:base64EncodedThumprintHere" and "typ:JWT" should be added to the header.

Related gh-9208

@marcerik marcerik added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Jun 2, 2021
@jzheaux jzheaux added in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 2, 2021
@jgrandja
Copy link
Contributor

jgrandja commented Jun 7, 2021

Thanks for the report @marcerik.

You mention x5t:base64EncodedThumprintHere but do you mean the x5t header?

The ability to customize the Jwt client assertion will be allowed after we merge gh-9208. See this related comment.

@jgrandja jgrandja added type: enhancement A general enhancement and removed type: bug A general bug labels Jun 7, 2021
@jgrandja jgrandja added this to the 5.6.x milestone Jun 7, 2021
@marcerik
Copy link
Author

marcerik commented Jun 8, 2021

Sorry for the confusion. What I mean is that the the "x5t" and "typ" header parameters are missing from the client_assertion.
image

@jgrandja
Copy link
Contributor

jgrandja commented Jun 8, 2021

No worries @marcerik. This issue will be resolved after gh-9208 is merged, which will provide the ability to fully customize the Jwt assertion.

@jgrandja
Copy link
Contributor

@marcerik I'm going to close this as a duplicate of gh-9855.

Please follow gh-9855 to ensure the enhancement meets your requirements. It's planned for 5.7.x.

@jgrandja jgrandja removed this from the 5.6.x milestone Oct 20, 2021
@jgrandja jgrandja added status: duplicate A duplicate of another issue and removed type: enhancement A general enhancement labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants