@Immutable public class JWTBearerGrant extends AssertionGrant
The JWT assertion can be:
Related specifications:
Modifier and Type | Field and Description |
---|---|
static GrantType |
GRANT_TYPE
The grant type.
|
MISSING_ASSERTION_PARAM_EXCEPTION, MISSING_GRANT_TYPE_PARAM_EXCEPTION
Constructor and Description |
---|
JWTBearerGrant(com.nimbusds.jwt.EncryptedJWT assertion)
Creates a new signed and encrypted JSON Web Token (JWT) bearer
assertion grant.
|
JWTBearerGrant(com.nimbusds.jose.JWEObject assertion)
Creates a new nested signed and encrypted JSON Web Token (JWT)
bearer assertion grant.
|
JWTBearerGrant(com.nimbusds.jwt.SignedJWT assertion)
Creates a new signed JSON Web Token (JWT) bearer assertion grant.
|
Modifier and Type | Method and Description |
---|---|
String |
getAssertion()
Gets the assertion.
|
com.nimbusds.jose.JOSEObject |
getJOSEAssertion()
Gets the JSON Web Token (JWT) bearer assertion.
|
com.nimbusds.jwt.JWT |
getJWTAssertion()
Gets the JSON Web Token (JWT) bearer assertion.
|
static JWTBearerGrant |
parse(Map<String,String> params)
Parses a JWT bearer grant from the specified parameters.
|
Map<String,String> |
toParameters()
Return the parameters for the authorisation grant.
|
getType
public static final GrantType GRANT_TYPE
public JWTBearerGrant(com.nimbusds.jwt.SignedJWT assertion)
assertion
- The signed JSON Web Token (JWT) assertion. Must not
be in a unsigned state or null
. The JWT
claims are not validated for compliance with the
standard.public JWTBearerGrant(com.nimbusds.jose.JWEObject assertion)
assertion
- The nested signed and encrypted JSON Web Token
(JWT) assertion. Must not be in a unencrypted state
or null
. The JWT claims are not validated
for compliance with the standard.public JWTBearerGrant(com.nimbusds.jwt.EncryptedJWT assertion)
assertion
- The signed and encrypted JSON Web Token (JWT)
assertion. Must not be in a unencrypted state or
null
. The JWT claims are not validated for
compliance with the standard.public com.nimbusds.jwt.JWT getJWTAssertion()
null
if
the assertion is a signed and encrypted JWT.public com.nimbusds.jose.JOSEObject getJOSEAssertion()
public String getAssertion()
AssertionGrant
getAssertion
in class AssertionGrant
public Map<String,String> toParameters()
AuthorizationGrant
toParameters
in class AuthorizationGrant
public static JWTBearerGrant parse(Map<String,String> params) throws ParseException
Example:
grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &assertion=eyJhbGciOiJFUzI1NiJ9.eyJpc3Mi[...omitted for brevity...]. J9l-ZhwP[...omitted for brevity...]
params
- The parameters.ParseException
- If parsing failed.Copyright © 2016 Connect2id Ltd.. All rights reserved.