public class OAuth2Jwt extends Object
Modifier and Type | Method and Description |
---|---|
static OAuth2Jwt |
create(String jwtString)
Creates an
OAuth2Jwt instance from the provided JWT string. |
org.forgerock.json.jose.jws.SignedJwt |
getSignedJwt()
Gets the Signed JWT.
|
String |
getSubject()
Gets the JWT subject.
|
boolean |
isContentValid()
Verifies that the JWT is valid by:
ensuring the JWT contains the 'iss', 'sub', 'aud' and 'exp' claims
ensuring the JWT expiry is not unreasonably far in the future
ensuring the JWT has not expired
ensuring the JWT is not being used before its 'not before time'
ensuring the JWT issued at time is not unreasonably far in the past
|
boolean |
isExpired()
Checks that the JWT has not expired.
|
boolean |
isIntendedForAudience(String audience)
Checks that the JWT is intended for the provided audience.
|
boolean |
isValid(org.forgerock.json.jose.jws.handlers.SigningHandler signingHandler)
Verifies that the JWT is valid by:
verifying the signature
ensuring the JWT contains the 'iss', 'sub', 'aud' and 'exp' claims
ensuring the JWT expiry is not unreasonably far in the future
ensuring the JWT has not expired
ensuring the JWT is not being used before its 'not before time'
ensuring the JWT issued at time is not unreasonably far in the past
|
public static OAuth2Jwt create(String jwtString)
OAuth2Jwt
instance from the provided JWT string.jwtString
- The JWT string.OAuth2Jwt
instance.public boolean isValid(org.forgerock.json.jose.jws.handlers.SigningHandler signingHandler)
signingHandler
- The SigningHandler
instance to verify the JWT signature with.true
if the JWT meets all the expectations.public boolean isContentValid()
true
if the JWT meets all the expectations.public boolean isExpired()
true
if the JWT has expired.public boolean isIntendedForAudience(String audience)
audience
- The audience.true
if the JWT 'audience' claim contains the provided audience.public String getSubject()
public org.forgerock.json.jose.jws.SignedJwt getSignedJwt()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.