Hello!
I’m having some trouble getting JWT assertions to work in a Spring Boot application for an Okta Open ID application integration.
Note the Spring Boot app works with this same OKTA application using client secret, and works with Entra ID for both client secret and JWT assertions.
However, when I try to authenticate with Okta using a JWT assertion, it returns a 401 unauthorized error message as follows:
org.springframework.web.reactive.function.client.WebClientResponseException$Unauthorized: 401 Unauthorized from POST https://dev-60265957.okta.com/oauth2/default/v1/token
This is the JSON version of the public key, which I upload to the Okta app:
{
“kty”: “RSA”,
“e”: “AQAB”,
“n”: “r9IcVK_9POl3R…”,
“use”: “sig”,
“kid”: “abc”,
“alg”: “RS256”
}
I also validated the JWT assertion against the public key using jwt.io, and it confirms the signature is verified (see image)
Below is the authorization code request, which as I said works fine with client secret:
https://dev-60265957.okta.com/oauth2/default/v1/authorize?client_id=0oaljin739TC
pu5Bu5d7&redirect_uri=https%3A%2F%2Flocalhost%3A8443%2Fmy_redirect_api&response_type=code&scope=openid%20email%20profile%20offline_access&sso_reload=true&state=aaaa&nonce=bbbb
Any ideas on what I’m doing wrong for the JWT assertion?
Thanks!
