Package com.nimbusds.oauth2.sdk.auth
Class JWTAuthenticationClaimsSet
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.assertions.AssertionDetails
-
- com.nimbusds.oauth2.sdk.assertions.jwt.JWTAssertionDetails
-
- com.nimbusds.oauth2.sdk.auth.JWTAuthenticationClaimsSet
-
public class JWTAuthenticationClaimsSet extends JWTAssertionDetails
JWT client authentication claims set, serialisable to a JSON object and JWT claims set.Used for
client secret JWTandprivate key JWTauthentication at the Token endpoint.Example client authentication claims set:
{ "iss" : "http://client.example.com", "sub" : "http://client.example.com", "aud" : [ "http://idp.example.com/token" ], "jti" : "d396036d-c4d9-40d8-8e98-f7e8327002d9", "exp" : 1311281970, "iat" : 1311280970 }Related specifications:
- OAuth 2.0 (RFC 6749), section-3.2.1.
- JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication and Authorization Grants (RFC 7523).
-
-
Constructor Summary
Constructors Constructor Description JWTAuthenticationClaimsSet(ClientID clientID, Audience aud)Creates a new JWT client authentication claims set.JWTAuthenticationClaimsSet(ClientID clientID, List<Audience> aud, Date exp, Date nbf, Date iat, JWTID jti)Creates a new JWT client authentication claims set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientIDgetClientID()Gets the client identifier.static JWTAuthenticationClaimsSetparse(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)Parses a JWT client authentication claims set from the specified JWT claims set.static JWTAuthenticationClaimsSetparse(net.minidev.json.JSONObject jsonObject)Parses a JWT client authentication claims set from the specified JSON object.-
Methods inherited from class com.nimbusds.oauth2.sdk.assertions.jwt.JWTAssertionDetails
getCustomClaims, getJWTID, getNotBeforeTime, getReservedClaimsNames, toJSONObject, toJWTClaimsSet
-
Methods inherited from class com.nimbusds.oauth2.sdk.assertions.AssertionDetails
getAudience, getExpirationTime, getID, getIssuer, getIssueTime, getSubject
-
-
-
-
Constructor Detail
-
JWTAuthenticationClaimsSet
public JWTAuthenticationClaimsSet(ClientID clientID, Audience aud)
Creates a new JWT client authentication claims set. The expiration time (exp) is set to five minutes from the current system time. Generates a default identifier (jti) for the JWT. The issued-at (iat) and not-before (nbf) claims are not set.- Parameters:
clientID- The client identifier. Used to specify the issuer and the subject. Must not benull.aud- The audience identifier, typically the URI of the authorisation server's Token endpoint. Must not benull.
-
JWTAuthenticationClaimsSet
public JWTAuthenticationClaimsSet(ClientID clientID, List<Audience> aud, Date exp, Date nbf, Date iat, JWTID jti)
Creates a new JWT client authentication claims set.- Parameters:
clientID- The client identifier. Used to specify the issuer and the subject. Must not benull.aud- The audience, typically including the URI of the authorisation server's Token endpoint. Must not benull.exp- The expiration time. Must not benull.nbf- The time before which the token must not be accepted for processing,nullif not specified.iat- The time at which the token was issued,nullif not specified.jti- Unique identifier for the JWT,nullif not specified.
-
-
Method Detail
-
getClientID
public ClientID getClientID()
Gets the client identifier. Corresponds to theissandsubclaims.- Returns:
- The client identifier.
-
parse
public static JWTAuthenticationClaimsSet parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses a JWT client authentication claims set from the specified JSON object.- Parameters:
jsonObject- The JSON object. Must not benull.- Returns:
- The client authentication claims set.
- Throws:
ParseException- If the JSON object couldn't be parsed to a client authentication claims set.
-
parse
public static JWTAuthenticationClaimsSet parse(com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) throws ParseException
Parses a JWT client authentication claims set from the specified JWT claims set.- Parameters:
jwtClaimsSet- The JWT claims set. Must not benull.- Returns:
- The client authentication claims set.
- Throws:
ParseException- If the JWT claims set couldn't be parsed to a client authentication claims set.
-
-