public class WebSSOProfileConsumerImpl extends AbstractProfileBase implements WebSSOProfileConsumer
artifactMap, builderFactory, log, metadata, processor, uriComparator
Constructor and Description |
---|
WebSSOProfileConsumerImpl() |
WebSSOProfileConsumerImpl(SAMLProcessor processor,
MetadataManager manager) |
Modifier and Type | Method and Description |
---|---|
long |
getMaxAuthenticationAge()
Maximum time between authentication of user and processing of an authentication statement.
|
String |
getProfileIdentifier()
Implementation are expected to provide an unique identifier for the profile this class implements.
|
boolean |
isIncludeAllAttributes() |
boolean |
isReleaseDOM() |
protected Serializable |
processAdditionalData(SAMLMessageContext context)
This is a hook method enabling subclasses to process additional data from the SAML exchange, like assertions with different confirmations
or additional attributes.
|
SAMLCredential |
processAuthenticationResponse(SAMLMessageContext context)
The input context object must have set the properties related to the returned Response, which is validated
and in case no errors are found the SAMLCredential is returned.
|
void |
setIncludeAllAttributes(boolean includeAllAttributes)
Flag indicates whether to include attributes from all assertions (value true), or only from
the assertion which was authentication using the Bearer SubjectConfirmation (value false, by default).
|
void |
setMaxAuthenticationAge(long maxAuthenticationAge)
Sets maximum time between users authentication and processing of an authentication statement.
|
void |
setReleaseDOM(boolean releaseDOM)
Flag indicates whether to release internal structure of the assertion returned in SAMLCredential.
|
protected void |
verifyAssertion(org.opensaml.saml2.core.Assertion assertion,
org.opensaml.saml2.core.AuthnRequest request,
SAMLMessageContext context) |
protected void |
verifyAssertionConditions(org.opensaml.saml2.core.Conditions conditions,
SAMLMessageContext context,
boolean audienceRequired) |
protected void |
verifyAssertionSignature(org.opensaml.xml.signature.Signature signature,
SAMLMessageContext context)
Verifies signature of the assertion.
|
protected void |
verifyAudience(SAMLMessageContext context,
List<org.opensaml.saml2.core.AudienceRestriction> audienceRestrictions)
Method verifies audience restrictions of the assertion.
|
protected void |
verifyAuthenticationStatement(org.opensaml.saml2.core.AuthnStatement auth,
org.opensaml.saml2.core.RequestedAuthnContext requestedAuthnContext,
SAMLMessageContext context)
Verifies that authentication statement is valid.
|
protected void |
verifyAuthnContext(org.opensaml.saml2.core.RequestedAuthnContext requestedAuthnContext,
org.opensaml.saml2.core.AuthnContext receivedContext,
SAMLMessageContext context)
Implementation is expected to verify that the requested authentication context corresponds with the received value.
|
protected void |
verifyConditions(SAMLMessageContext context,
List<org.opensaml.saml2.core.Condition> conditions)
Verifies conditions of the assertion which were are not understood.
|
protected void |
verifySubject(org.opensaml.saml2.core.Subject subject,
org.opensaml.saml2.core.AuthnRequest request,
SAMLMessageContext context)
Verifies validity of Subject element, only bearer confirmation is validated.
|
afterPropertiesSet, buildCommonAttributes, generateID, getEndpointBinding, getIssuer, getMaxAssertionTime, getResponseSkew, getStatus, isEndpointMatching, sendMessage, sendMessage, setArtifactMap, setMaxAssertionTime, setMetadata, setProcessor, setResponseSkew, verifyEndpoint, verifyIssuer, verifySignature
public WebSSOProfileConsumerImpl()
public WebSSOProfileConsumerImpl(SAMLProcessor processor, MetadataManager manager)
public String getProfileIdentifier()
AbstractProfileBase
getProfileIdentifier
in class AbstractProfileBase
public SAMLCredential processAuthenticationResponse(SAMLMessageContext context) throws org.opensaml.common.SAMLException, org.opensaml.xml.security.SecurityException, org.opensaml.xml.validation.ValidationException, org.opensaml.xml.encryption.DecryptionException
processAuthenticationResponse
in interface WebSSOProfileConsumer
context
- context including response objectorg.opensaml.common.SAMLException
- in case the response is invalidorg.opensaml.xml.security.SecurityException
- in the signature on response can't be verifiedorg.opensaml.xml.validation.ValidationException
- in case the response structure is not conforming to the standardorg.opensaml.xml.encryption.DecryptionException
protected Serializable processAdditionalData(SAMLMessageContext context) throws org.opensaml.common.SAMLException
context
- context containing incoming messageorg.opensaml.common.SAMLException
- in case processing failsprotected void verifyAssertion(org.opensaml.saml2.core.Assertion assertion, org.opensaml.saml2.core.AuthnRequest request, SAMLMessageContext context) throws org.springframework.security.core.AuthenticationException, org.opensaml.common.SAMLException, org.opensaml.xml.security.SecurityException, org.opensaml.xml.validation.ValidationException, org.opensaml.xml.encryption.DecryptionException
org.springframework.security.core.AuthenticationException
org.opensaml.common.SAMLException
org.opensaml.xml.security.SecurityException
org.opensaml.xml.validation.ValidationException
org.opensaml.xml.encryption.DecryptionException
protected void verifySubject(org.opensaml.saml2.core.Subject subject, org.opensaml.saml2.core.AuthnRequest request, SAMLMessageContext context) throws org.opensaml.common.SAMLException, org.opensaml.xml.encryption.DecryptionException
subject
- subject to validaterequest
- requestcontext
- contextorg.opensaml.common.SAMLException
- error validating the objectorg.opensaml.xml.encryption.DecryptionException
- in case the NameID can't be decryptedprotected void verifyAssertionSignature(org.opensaml.xml.signature.Signature signature, SAMLMessageContext context) throws org.opensaml.common.SAMLException, org.opensaml.xml.security.SecurityException, org.opensaml.xml.validation.ValidationException
signature
- signature to verifycontext
- contextorg.opensaml.common.SAMLException
- signature missing although requiredorg.opensaml.xml.security.SecurityException
- signature can't be validatedorg.opensaml.xml.validation.ValidationException
- signature is malformedprotected void verifyAssertionConditions(org.opensaml.saml2.core.Conditions conditions, SAMLMessageContext context, boolean audienceRequired) throws org.opensaml.common.SAMLException
org.opensaml.common.SAMLException
protected void verifyAudience(SAMLMessageContext context, List<org.opensaml.saml2.core.AudienceRestriction> audienceRestrictions) throws org.opensaml.common.SAMLException
context
- contextaudienceRestrictions
- audience restrictions to verifyorg.opensaml.common.SAMLException
- in case local entity doesn't match the audience restrictionsprotected void verifyConditions(SAMLMessageContext context, List<org.opensaml.saml2.core.Condition> conditions) throws org.opensaml.common.SAMLException
context
- message contextconditions
- conditions which were not understoodorg.opensaml.common.SAMLException
- in case conditions are not emptyprotected void verifyAuthenticationStatement(org.opensaml.saml2.core.AuthnStatement auth, org.opensaml.saml2.core.RequestedAuthnContext requestedAuthnContext, SAMLMessageContext context) throws org.springframework.security.core.AuthenticationException
auth
- statement to checkrequestedAuthnContext
- original requested context can be null for unsolicited messages or when no context was requestedcontext
- message contextorg.springframework.security.core.AuthenticationException
- in case the statement is invalidprotected void verifyAuthnContext(org.opensaml.saml2.core.RequestedAuthnContext requestedAuthnContext, org.opensaml.saml2.core.AuthnContext receivedContext, SAMLMessageContext context) throws org.springframework.security.authentication.InsufficientAuthenticationException
By default verification is done only for "exact" context. It is checked whether received context contains one of the requested method.
In case requestedAuthnContext is null no verification is done.
Method can be reimplemented in subclasses.
requestedAuthnContext
- context requested in the original request, null for unsolicited messages or when no context was requiredreceivedContext
- context from the response messagecontext
- saml contextorg.springframework.security.authentication.InsufficientAuthenticationException
- in case expected context doesn't correspond with the received valuepublic long getMaxAuthenticationAge()
public void setMaxAuthenticationAge(long maxAuthenticationAge)
maxAuthenticationAge
- authentication age (in seconds)public boolean isIncludeAllAttributes()
public void setIncludeAllAttributes(boolean includeAllAttributes)
includeAllAttributes
- true to include attributes from all assertionspublic boolean isReleaseDOM()
public void setReleaseDOM(boolean releaseDOM)
releaseDOM
- release dom flag