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()
.setAudience(audience) // defaults to ‘api://default’
.setConnectionTimeout(1000) // defaults to 1000ms
.setReadTimeout(1000) // defaults to 1000ms
.setClientId(clientID) // optional

		    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 -

1 Like

Thanks a lot @vijet for clarification.

1 Like