Class SAMLAuthFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
com.erudika.para.server.security.filters.SAMLAuthFilter
- All Implemented Interfaces:
jakarta.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.EnvironmentAware,org.springframework.context.MessageSourceAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public class SAMLAuthFilter
extends org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
A filter that handles authentication requests to a SAML 2.0 identity provider (IDP).
- Author:
- Alex Bogdanovski [[email protected]]
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.AuthenticationattemptAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles an authentication request.getOrCreateUser(com.erudika.para.core.App app, Map<String, List<Object>> samlAttributes) Creates or loads a Para user based on the SAML assertion attributes.Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
afterPropertiesSet, doFilter, getRememberMeServices, setAllowSessionCreation, setApplicationEventPublisher, setAuthenticationConverter, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setContinueChainBeforeSuccessfulAuthentication, setFilterProcessesUrl, setMessageSource, setMfaEnabled, setRememberMeServices, setRequiresAuthenticationRequestMatcher, setSecurityContextHolderStrategy, setSecurityContextRepository, setSessionAuthenticationStrategyMethods inherited from class org.springframework.web.filter.GenericFilterBean
destroy, getEnvironment, getFilterConfig, init, setBeanName, setEnvironment, setServletContext
-
Field Details
-
SAML_ACTION
The default filter mapping.- See Also:
-
-
Constructor Details
-
SAMLAuthFilter
Default constructor.- Parameters:
defaultFilterProcessesUrl- the url of the filter
-
-
Method Details
-
attemptAuthentication
public org.springframework.security.core.Authentication attemptAuthentication(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException Handles an authentication request.- Overrides:
attemptAuthenticationin classorg.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter- Parameters:
request- HTTP requestresponse- HTTP response- Returns:
- an authentication object that contains the principal object if successful.
- Throws:
IOException- ex
-
getOrCreateUser
public UserAuthentication getOrCreateUser(com.erudika.para.core.App app, Map<String, List<Object>> samlAttributes) throws IOExceptionCreates or loads a Para user based on the SAML assertion attributes.- Parameters:
app- the app where the user will be created, use null for root appsamlAttributes- SAML attibutes from response assertion- Returns:
UserAuthenticationobject or null if something went wrong- Throws:
IOException- ex
-