Class AuthenticationHeadersLoginProcessor
java.lang.Object
org.craftercms.security.processors.impl.AuthenticationHeadersLoginProcessor
- All Implemented Interfaces:
RequestSecurityProcessor
RequestSecurityProcessor
that auto logins a user through the headers
provided by the Apache mod_auth_mellon SAML authentication module. If the user doesn't exist, it creates it.- Author:
- avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthenticationManager
static final String
static final String
static final String
static final String
protected String
static final org.slf4j.Logger
protected String
protected ProfileService
protected TenantService
protected TenantsResolver
protected String
protected String
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Profile
createProfileWithSsoInfo
(String username, Tenant tenant, javax.servlet.http.HttpServletRequest request) protected Tenant
getSsoEnabledTenant
(String[] tenantNames) protected boolean
hasValidToken
(javax.servlet.http.HttpServletRequest request) void
processRequest
(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) Processes a request, enforcing security when required.void
setAuthenticationManager
(AuthenticationManager authenticationManager) void
setEmailHeaderName
(String emailHeaderName) void
setMellonHeaderPrefix
(String mellonHeaderPrefix) void
setProfileService
(ProfileService profileService) void
setTenantService
(TenantService tenantService) void
setTenantsResolver
(TenantsResolver tenantsResolver) void
setTokenExpectedValue
(String tokenExpectedValue) void
setTokenHeaderName
(String tokenHeaderName) void
setUsernameHeaderName
(String usernameHeaderName)
-
Field Details
-
logger
public static final org.slf4j.Logger logger -
DEFAULT_MELLON_HEADER_PREFIX
- See Also:
-
DEFAULT_USERNAME_HEADER_NAME
- See Also:
-
DEFAULT_EMAIL_HEADER_NAME
- See Also:
-
DEFAULT_TOKEN_HEADER_NAME
- See Also:
-
tenantService
-
profileService
-
tenantsResolver
-
authenticationManager
-
mellonHeaderPrefix
-
usernameHeaderName
-
emailHeaderName
-
tokenHeaderName
-
tokenExpectedValue
-
-
Constructor Details
-
AuthenticationHeadersLoginProcessor
public AuthenticationHeadersLoginProcessor()
-
-
Method Details
-
setTenantService
-
setProfileService
-
setTenantsResolver
-
setAuthenticationManager
-
setMellonHeaderPrefix
-
setUsernameHeaderName
-
setEmailHeaderName
-
setTokenHeaderName
-
setTokenExpectedValue
-
getTokenExpectedValue
-
processRequest
public void processRequest(org.craftercms.commons.http.RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception Description copied from interface:RequestSecurityProcessor
Processes a request, enforcing security when required.- Specified by:
processRequest
in interfaceRequestSecurityProcessor
- Parameters:
context
- the context which holds the current request and responseprocessorChain
- theRequestSecurityProcessorChain
, used to call the next processor- Throws:
Exception
-
hasValidToken
protected boolean hasValidToken(javax.servlet.http.HttpServletRequest request) -
getSsoEnabledTenant
- Throws:
ProfileException
-
createProfileWithSsoInfo
protected Profile createProfileWithSsoInfo(String username, Tenant tenant, javax.servlet.http.HttpServletRequest request) throws ProfileException - Throws:
ProfileException
-