Package com.nimbusds.oauth2.sdk
Class SAML2BearerGrant
java.lang.Object
com.nimbusds.oauth2.sdk.AuthorizationGrant
com.nimbusds.oauth2.sdk.AssertionGrant
com.nimbusds.oauth2.sdk.SAML2BearerGrant
SAML 2.0 bearer grant. Used in access token requests with a SAML 2.0 bearer
assertion.
Related specifications:
- Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants (RFC 7521), section 4.1.
- SAML 2.0 Profile for OAuth 2.0 Client Authentication and Authorization Grants (RFC 7522), section-2.1.
-
Field Summary
FieldsFields inherited from class com.nimbusds.oauth2.sdk.AssertionGrant
MISSING_ASSERTION_PARAM_EXCEPTION
-
Constructor Summary
ConstructorsConstructorDescriptionSAML2BearerGrant
(com.nimbusds.jose.util.Base64URL assertion) Creates a new SAML 2.0 bearer assertion grant. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the assertion.com.nimbusds.jose.util.Base64URL
Gets the SAML 2.0 bearer assertion.int
hashCode()
static SAML2BearerGrant
Parses a SAML 2.0 bearer grant from the specified request body parameters.Returns the request body parameters for the authorisation grant.Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationGrant
getType
-
Field Details
-
GRANT_TYPE
The grant type.
-
-
Constructor Details
-
SAML2BearerGrant
Creates a new SAML 2.0 bearer assertion grant.- Parameters:
assertion
- The SAML 2.0 bearer assertion. Must not benull
.
-
-
Method Details
-
getSAML2Assertion
Gets the SAML 2.0 bearer assertion.- Returns:
- The SAML 2.0 bearer assertion.
-
getAssertion
Description copied from class:AssertionGrant
Gets the assertion.- Specified by:
getAssertion
in classAssertionGrant
- Returns:
- The assertion as a string.
-
toParameters
Description copied from class:AuthorizationGrant
Returns the request body parameters for the authorisation grant.- Specified by:
toParameters
in classAuthorizationGrant
- Returns:
- The parameters.
-
equals
-
hashCode
-
parse
Parses a SAML 2.0 bearer grant from the specified request body parameters.Example:
grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2- bearer&assertion=PEFzc2VydGlvbiBJc3N1ZUluc3RhbnQ9IjIwMTEtMDU [...omitted for brevity...]aG5TdGF0ZW1lbnQ-PC9Bc3NlcnRpb24-
- Parameters:
params
- The parameters.- Returns:
- The SAML 2.0 bearer grant.
- Throws:
ParseException
- If parsing failed.
-