Class SAML2AssertionDetailsVerifier
java.lang.Object
com.nimbusds.oauth2.sdk.assertions.saml2.SAML2AssertionDetailsVerifier
- All Implemented Interfaces:
com.nimbusds.jwt.proc.ClockSkewAware
@Immutable
public class SAML2AssertionDetailsVerifier
extends Object
implements com.nimbusds.jwt.proc.ClockSkewAware
SAML 2.0 bearer assertion details verifier for OAuth 2.0 client
authentication and authorisation grants. Intended for initial validation of
SAML 2.0 assertions:
- Audience check
- Expiration time check
- Not-before time check (is set)
Related specifications:
- Security Assertion Markup Language (SAML) 2.0 Profile for OAuth 2.0 Client Authentication and Authorization Grants (RFC 7522)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The default maximum acceptable clock skew, in seconds (60). -
Constructor Summary
ConstructorsConstructorDescriptionSAML2AssertionDetailsVerifier
(Set<Audience> expectedAudience) Creates a new SAML 2.0 bearer assertion details verifier. -
Method Summary
Modifier and TypeMethodDescriptionReturns the expected audience values.int
void
setMaxClockSkew
(int maxClockSkewSeconds) void
verify
(SAML2AssertionDetails assertionDetails) Verifies the specified SAML 2.0 bearer assertion details.
-
Field Details
-
DEFAULT_MAX_CLOCK_SKEW_SECONDS
The default maximum acceptable clock skew, in seconds (60).- See Also:
-
-
Constructor Details
-
SAML2AssertionDetailsVerifier
Creates a new SAML 2.0 bearer assertion details verifier.- Parameters:
expectedAudience
- The expected audience values. Must not be empty ornull
. Should typically contain the token endpoint URI and for OpenID provider it may also include the issuer URI.
-
-
Method Details
-
getExpectedAudience
Returns the expected audience values.- Returns:
- The expected audience values.
-
getMaxClockSkew
- Specified by:
getMaxClockSkew
in interfacecom.nimbusds.jwt.proc.ClockSkewAware
-
setMaxClockSkew
- Specified by:
setMaxClockSkew
in interfacecom.nimbusds.jwt.proc.ClockSkewAware
-
verify
Verifies the specified SAML 2.0 bearer assertion details.- Parameters:
assertionDetails
- The SAML 2.0 bearer assertion details. Must not benull
.- Throws:
BadSAML2AssertionException
- If verification didn't pass successfully.
-