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
-
@Immutable public class SAML2BearerGrant extends AssertionGrant
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
Fields Modifier and Type Field Description static GrantType
GRANT_TYPE
The grant type.-
Fields inherited from class com.nimbusds.oauth2.sdk.AssertionGrant
MISSING_ASSERTION_PARAM_EXCEPTION, MISSING_GRANT_TYPE_PARAM_EXCEPTION
-
-
Constructor Summary
Constructors Constructor Description SAML2BearerGrant(com.nimbusds.jose.util.Base64URL assertion)
Creates a new SAML 2.0 bearer assertion grant.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getAssertion()
Gets the assertion.com.nimbusds.jose.util.Base64URL
getSAML2Assertion()
Gets the SAML 2.0 bearer assertion.int
hashCode()
static SAML2BearerGrant
parse(Map<String,List<String>> params)
Parses a SAML 2.0 bearer grant from the specified request body parameters.Map<String,List<String>>
toParameters()
Returns the request body parameters for the authorisation grant.-
Methods inherited from class com.nimbusds.oauth2.sdk.AuthorizationGrant
getType
-
-
-
-
Field Detail
-
GRANT_TYPE
public static final GrantType GRANT_TYPE
The grant type.
-
-
Constructor Detail
-
SAML2BearerGrant
public SAML2BearerGrant(com.nimbusds.jose.util.Base64URL assertion)
Creates a new SAML 2.0 bearer assertion grant.- Parameters:
assertion
- The SAML 2.0 bearer assertion. Must not benull
.
-
-
Method Detail
-
getSAML2Assertion
public com.nimbusds.jose.util.Base64URL getSAML2Assertion()
Gets the SAML 2.0 bearer assertion.- Returns:
- The SAML 2.0 bearer assertion.
-
getAssertion
public String getAssertion()
Description copied from class:AssertionGrant
Gets the assertion.- Specified by:
getAssertion
in classAssertionGrant
- Returns:
- The assertion as a string.
-
toParameters
public Map<String,List<String>> toParameters()
Description copied from class:AuthorizationGrant
Returns the request body parameters for the authorisation grant.- Specified by:
toParameters
in classAuthorizationGrant
- Returns:
- The parameters.
-
parse
public static SAML2BearerGrant parse(Map<String,List<String>> params) throws ParseException
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.
-
-