Class SAML2Authenticator
java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.profile.definition.ProfileDefinitionAware
org.pac4j.saml.credentials.authenticator.SAML2Authenticator
- All Implemented Interfaces:
org.pac4j.core.credentials.authenticator.Authenticator
public class SAML2Authenticator
extends org.pac4j.core.profile.definition.ProfileDefinitionAware
implements org.pac4j.core.credentials.authenticator.Authenticator
Authenticator for SAML 2.0
- Since:
- 2.0.0
- Author:
- Jerome Leleu
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantAUTHN_CONTEXT="authnContext"
static final String
ConstantAUTHN_CONTEXT_AUTHORITIES="authnContextAuthorities"
static final String
ConstantISSUER_ID="issuerId"
protected final org.slf4j.Logger
static final String
ConstantSAML_CONDITION_NOT_BEFORE_ATTRIBUTE="notBefore"
static final String
ConstantSAML_CONDITION_NOT_ON_OR_AFTER_ATTRIBUTE="notOnOrAfter"
static final String
ConstantSAML_NAME_ID_FORMAT="samlNameIdFormat"
static final String
ConstantSAML_NAME_ID_NAME_QUALIFIER="samlNameIdNameQualifier"
static final String
ConstantSAML_NAME_ID_SP_NAME_QUALIFIER="samlNameIdSpNameQualifier"
static final String
ConstantSAML_NAME_ID_SP_PROVIDED_ID="samlNameIdSpProvidedId"
static final String
ConstantSESSION_INDEX="sessionindex"
Fields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE, NEVER_VALIDATE
-
Constructor Summary
ConstructorDescriptionSAML2Authenticator
(SAML2ResponseValidator loginValidator, SAML2LogoutValidator logoutValidator, String attributeAsId) Constructor for SAML2Authenticator.SAML2Authenticator
(SAML2ResponseValidator loginValidator, SAML2LogoutValidator logoutValidator, String attributeAsId, Map<String, String> mappedAttributes) Constructor for SAML2Authenticator. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
buildProfile
(SAML2AuthenticationCredentials credentials) buildProfile.protected void
internalInit
(boolean forceReinit) Optional<org.pac4j.core.credentials.Credentials>
validate
(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials extractedCredentials) Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinitionAware
getProfileDefinition, setProfileDefinition, setProfileDefinitionIfUndefined
Methods inherited from class org.pac4j.core.util.InitializableObject
afterInternalInit, beforeInternalInit, getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize, toString
-
Field Details
-
SAML_CONDITION_NOT_BEFORE_ATTRIBUTE
ConstantSAML_CONDITION_NOT_BEFORE_ATTRIBUTE="notBefore"
- See Also:
-
SAML_CONDITION_NOT_ON_OR_AFTER_ATTRIBUTE
ConstantSAML_CONDITION_NOT_ON_OR_AFTER_ATTRIBUTE="notOnOrAfter"
- See Also:
-
SESSION_INDEX
ConstantSESSION_INDEX="sessionindex"
- See Also:
-
ISSUER_ID
ConstantISSUER_ID="issuerId"
- See Also:
-
AUTHN_CONTEXT
ConstantAUTHN_CONTEXT="authnContext"
- See Also:
-
AUTHN_CONTEXT_AUTHORITIES
ConstantAUTHN_CONTEXT_AUTHORITIES="authnContextAuthorities"
- See Also:
-
SAML_NAME_ID_FORMAT
ConstantSAML_NAME_ID_FORMAT="samlNameIdFormat"
- See Also:
-
SAML_NAME_ID_NAME_QUALIFIER
ConstantSAML_NAME_ID_NAME_QUALIFIER="samlNameIdNameQualifier"
- See Also:
-
SAML_NAME_ID_SP_NAME_QUALIFIER
ConstantSAML_NAME_ID_SP_NAME_QUALIFIER="samlNameIdSpNameQualifier"
- See Also:
-
SAML_NAME_ID_SP_PROVIDED_ID
ConstantSAML_NAME_ID_SP_PROVIDED_ID="samlNameIdSpProvidedId"
- See Also:
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
SAML2Authenticator
public SAML2Authenticator(SAML2ResponseValidator loginValidator, SAML2LogoutValidator logoutValidator, String attributeAsId, Map<String, String> mappedAttributes) Constructor for SAML2Authenticator.
- Parameters:
loginValidator
- aSAML2ResponseValidator
objectlogoutValidator
- aSAML2LogoutValidator
objectattributeAsId
- aString
objectmappedAttributes
- aMap
object
-
SAML2Authenticator
public SAML2Authenticator(SAML2ResponseValidator loginValidator, SAML2LogoutValidator logoutValidator, String attributeAsId) Constructor for SAML2Authenticator.
- Parameters:
loginValidator
- aSAML2ResponseValidator
objectlogoutValidator
- aSAML2LogoutValidator
objectattributeAsId
- aString
object
-
-
Method Details
-
internalInit
protected void internalInit(boolean forceReinit) - Specified by:
internalInit
in classorg.pac4j.core.util.InitializableObject
-
validate
public Optional<org.pac4j.core.credentials.Credentials> validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials extractedCredentials) - Specified by:
validate
in interfaceorg.pac4j.core.credentials.authenticator.Authenticator
-
buildProfile
buildProfile.
- Parameters:
credentials
- aSAML2AuthenticationCredentials
object
-