Decode Okta ID_Token

Hi ,
When I decode id_token received from Okta , its giving me payload details in claim . but when I extract kid from claims , its giving null. please assist.

JwtVerifier jwtVerifier = new JwtHelper()
.setIssuerUrl(issuerUrl)
.setAudience(audience) // defaults to ‘api://default’
.setConnectionTimeout(1000) // defaults to 1000ms
.setReadTimeout(1000) // defaults to 1000ms
.setClientId(clientID) // optional
.build();

		    Jwt jwt = jwtVerifier.decodeIdToken(jwtString, nounce);
			
		   System.out.println("kid: " + jwt.getClaims().get("kid") );

Hi Bipin,

kid is not a claim that can be extracted from the jwt payload.
It is present in the jwt header to verify its signature and if you’re using okta jwt verifier, you don’t have to worry about kid or signature validation which is handled for you.

Take a look at the following standard claims supported by OIDC - http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims

1 Like

Thanks a lot @vijet for clarification.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.