Class SwedishEidAuthnStatementValidator
- java.lang.Object
-
- org.opensaml.saml.saml2.assertion.impl.AuthnStatementValidator
-
- se.litsec.opensaml.saml2.common.assertion.AuthnStatementValidator
-
- se.litsec.swedisheid.opensaml.saml2.validation.SwedishEidAuthnStatementValidator
-
- All Implemented Interfaces:
StatementValidator
public class SwedishEidAuthnStatementValidator extends AuthnStatementValidator
AnAuthnStatementValidatorthat performs checks to assert that the assertion is compliant with the Swedish eID Framework.Supports the following
ValidationContextstatic parameters:- The ones defined in
AuthnStatementValidator. AUTHN_REQUEST_REQUESTED_AUTHNCONTEXTURIS: Holds a collection of AuthnContext URIs that are matched against theAuthnContextClassRefelement of the authentication statement. If not supplied, the values are read fromCoreValidatorParameters.AUTHN_REQUEST.
- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHN_REQUEST_REQUESTED_AUTHNCONTEXTURISKey for a validation context parameter.-
Fields inherited from class se.litsec.opensaml.saml2.common.assertion.AuthnStatementValidator
AUTHN_REQUEST_FORCE_AUTHN, AUTHN_REQUEST_ISSUE_INSTANT, MAX_ACCEPTED_SSO_SESSION_TIME
-
-
Constructor Summary
Constructors Constructor Description SwedishEidAuthnStatementValidator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static Collection<String>getRequestedAuthnContextUris(ValidationContext context)Returns a collection of URIs that are the RequestedAuthnContext URIs given in theAuthnRequest.protected ValidationResultvalidateAuthnContext(AuthnStatement statement, Assertion assertion, ValidationContext context)Overrides default implementation with checks that assert that aAuthnContextClassRefURI was received, and that it matches what was requested.protected ValidationResultvalidateAuthnContextClassRef(String authnContextClassRef, Collection<String> requestedContextClassRefs, AuthnStatement statement, Assertion assertion, ValidationContext context)Checks the issued AuthnContextClassRef against the ones that were requested.-
Methods inherited from class se.litsec.opensaml.saml2.common.assertion.AuthnStatementValidator
getAuthnRequestIssueInstant, getForceAuthnFlag, getMaxAcceptedSsoSessionTime, validate, validate, validateAuthnInstant, validateSessionIndex, validateSessionNotOnOrAfter, validateSsoAndSession
-
Methods inherited from class org.opensaml.saml.saml2.assertion.impl.AuthnStatementValidator
getServicedStatement, validateSubjectLocality
-
-
-
-
Field Detail
-
AUTHN_REQUEST_REQUESTED_AUTHNCONTEXTURIS
public static final String AUTHN_REQUEST_REQUESTED_AUTHNCONTEXTURIS
Key for a validation context parameter. Carries aCollectionholding the requested AuthnContext URIs included in theAuthnRequest.- See Also:
- Constant Field Values
-
-
Method Detail
-
validateAuthnContext
protected ValidationResult validateAuthnContext(AuthnStatement statement, Assertion assertion, ValidationContext context)
Overrides default implementation with checks that assert that aAuthnContextClassRefURI was received, and that it matches what was requested.- Overrides:
validateAuthnContextin classAuthnStatementValidator
-
validateAuthnContextClassRef
protected ValidationResult validateAuthnContextClassRef(String authnContextClassRef, Collection<String> requestedContextClassRefs, AuthnStatement statement, Assertion assertion, ValidationContext context)
Checks the issued AuthnContextClassRef against the ones that were requested. This method assumes "exact" matching.- Parameters:
authnContextClassRef- the AuthnContextClassRef from the assertionrequestedContextClassRefs- the requested levelsstatement- the authentication statementassertion- the assertioncontext- the validation context- Returns:
- validation result
-
getRequestedAuthnContextUris
protected static Collection<String> getRequestedAuthnContextUris(ValidationContext context)
Returns a collection of URIs that are the RequestedAuthnContext URIs given in theAuthnRequest. The method will first check if the parameterAUTHN_REQUEST_REQUESTED_AUTHNCONTEXTURISis set, and if not, use theCoreValidatorParameters.AUTHN_REQUEST.- Parameters:
context- the validation context- Returns:
- a collection of URIs.
-
-