@ConditionalOnProperty(value="genie.security.saml.enabled",
havingValue="true")
@Configuration
@Order(value=5)
public class SAMLConfig
extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
Modified from: https://github.com/vdenotaris/spring-boot-security-saml-sample which is basically a port of the context-xml from Spring SAML example.
Constructor and Description |
---|
SAMLConfig() |
Modifier and Type | Method and Description |
---|---|
org.springframework.security.saml.processor.HTTPArtifactBinding |
artifactBinding(org.opensaml.xml.parse.ParserPool parserPool,
org.apache.velocity.app.VelocityEngine velocityEngine)
HTTP Artifact binding.
|
org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler |
authenticationFailureHandler()
Handler deciding where to redirect user after failed login.
|
protected void |
configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
Defines the web based security configuration.
|
org.springframework.security.saml.context.SAMLContextProviderImpl |
contextProvider(SAMLProperties properties)
Provider of the SAML context.
|
org.springframework.security.saml.websso.WebSSOProfileOptions |
defaultWebSSOProfileOptions()
The Web SSO profile options.
|
org.springframework.security.saml.websso.WebSSOProfileECPImpl |
ecpprofile()
SAML 2.0 ECP profile.
|
org.springframework.security.saml.metadata.ExtendedMetadata |
extendedMetadata()
Setup the extended metadata for the SAML request.
|
org.springframework.security.saml.websso.WebSSOProfileConsumerHoKImpl |
hokWebSSOProfile()
SAML 2.0 Holder-of-Key Web SSO profile.
|
org.springframework.security.saml.websso.WebSSOProfileConsumerHoKImpl |
hokWebSSOprofileConsumer()
SAML 2.0 Holder-of-Key WebSSO Assertion Consumer.
|
org.apache.commons.httpclient.HttpClient |
httpClient()
The HTTP Client used to communicate with the IDP.
|
org.springframework.security.saml.processor.HTTPPAOS11Binding |
httpPAOS11Binding()
A PAOS binding to use.
|
org.springframework.security.saml.processor.HTTPPostBinding |
httpPostBinding()
A HTTP POST binding to use.
|
org.springframework.security.saml.processor.HTTPRedirectDeflateBinding |
httpRedirectDeflateBinding()
A HTTP redirect binding to use.
|
org.springframework.security.saml.processor.HTTPSOAP11Binding |
httpSOAP11Binding()
A SOAP binding to use.
|
org.springframework.security.saml.key.KeyManager |
keyManager()
Central storage of cryptographic keys.
|
org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler |
logoutHandler()
Logout handler terminating local session.
|
org.springframework.security.saml.websso.SingleLogoutProfile |
logoutProfile()
The logout profile for SAML single logout.
|
org.springframework.security.saml.metadata.CachingMetadataManager |
metadata(org.springframework.security.saml.metadata.ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider)
Get the metadata manager for the IDP metadata.
|
org.springframework.security.saml.metadata.MetadataDisplayFilter |
metadataDisplayFilter()
The filter is waiting for connections on URL suffixed with filterSuffix and presents SP metadata there.
|
org.springframework.security.saml.metadata.MetadataGenerator |
metadataGenerator()
Generates default SP metadata if none is set.
|
org.springframework.security.saml.metadata.MetadataGeneratorFilter |
metadataGeneratorFilter()
The metadata generator filter which generates metadata for the SP if non is pre-configured.
|
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager |
multiThreadedHttpConnectionManager()
Connection pool for the HTTP Client.
|
org.opensaml.xml.parse.StaticBasicParserPool |
parserPool()
Parser pool used for the OpenSAML parsing.
|
org.springframework.security.saml.parser.ParserPoolHolder |
parserPoolHolder()
The holder for the parser poole.
|
org.springframework.security.saml.processor.SAMLProcessorImpl |
processor()
The SAML processor that includes bindings for various communication protocols with the IDP.
|
org.springframework.security.saml.SAMLAuthenticationProvider |
samlAuthenticationProvider(org.springframework.security.saml.userdetails.SAMLUserDetailsService samlUserDetailsService)
Parses the response SAML messages.
|
static org.springframework.security.saml.SAMLBootstrap |
samlBootstrap()
Initialization of OpenSAML library.
|
org.springframework.security.saml.SAMLEntryPoint |
samlEntryPoint()
Entry point to initialize authentication, default values taken from properties file.
|
org.springframework.security.web.FilterChainProxy |
samlFilter()
Define the security filter chain in order to support SSO Auth by using SAML 2.0.
|
org.springframework.security.saml.SAMLDiscovery |
samlIDPDiscovery()
Setup the IDP discovery service.
|
org.springframework.security.saml.log.SAMLDefaultLogger |
samlLogger()
The Logger used by the SAML package.
|
org.springframework.security.saml.SAMLLogoutFilter |
samlLogoutFilter()
Overrides default logout processing filter with the one processing SAML messages.
|
org.springframework.security.saml.SAMLLogoutProcessingFilter |
samlLogoutProcessingFilter()
Filter to handle logout requests.
|
org.springframework.security.saml.SAMLWebSSOHoKProcessingFilter |
samlWebSSOHoKProcessingFilter()
Filter to process holder of key sso requests.
|
org.springframework.security.saml.SAMLProcessingFilter |
samlWebSSOProcessingFilter()
Processing filter for WebSSO profile messages.
|
org.springframework.security.saml.processor.HTTPSOAP11Binding |
soapBinding()
A SOAP binding to use.
|
org.springframework.security.saml.metadata.ExtendedMetadataDelegate |
ssoCircleExtendedMetadataProvider(SAMLProperties properties)
Setup the extended metadata delegate for the IDP.
|
org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler |
successLogoutHandler()
Handler for successful logout.
|
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler |
successRedirectHandler()
Handler deciding where to redirect user after successful login.
|
org.apache.velocity.app.VelocityEngine |
velocityEngine()
Initialize the velocity engine.
|
org.springframework.security.saml.websso.WebSSOProfile |
webSSOprofile()
SAML 2.0 Web SSO profile.
|
org.springframework.security.saml.websso.WebSSOProfileConsumer |
webSSOprofileConsumer()
SAML 2.0 WebSSO Assertion Consumer.
|
authenticationManager, authenticationManagerBean, configure, configure, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBean
@Bean public static org.springframework.security.saml.SAMLBootstrap samlBootstrap()
SAMLBootstrap
@Bean public org.apache.velocity.app.VelocityEngine velocityEngine()
VelocityEngine
@Bean(initMethod="initialize") public org.opensaml.xml.parse.StaticBasicParserPool parserPool()
StaticBasicParserPool
@Bean(name="parserPoolHolder") public org.springframework.security.saml.parser.ParserPoolHolder parserPoolHolder()
ParserPoolHolder
@Bean public org.apache.commons.httpclient.MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager()
MultiThreadedHttpConnectionManager
@Bean public org.apache.commons.httpclient.HttpClient httpClient()
HttpClient
@Bean public org.springframework.security.saml.SAMLAuthenticationProvider samlAuthenticationProvider(org.springframework.security.saml.userdetails.SAMLUserDetailsService samlUserDetailsService)
samlUserDetailsService
- The user details service to useSAMLAuthenticationProvider
@Bean public org.springframework.security.saml.context.SAMLContextProviderImpl contextProvider(SAMLProperties properties)
properties
- The SAML properties to useSAMLContextProviderImpl
@Bean public org.springframework.security.saml.log.SAMLDefaultLogger samlLogger()
SAMLDefaultLogger
@Bean public org.springframework.security.saml.websso.WebSSOProfileConsumer webSSOprofileConsumer()
WebSSOProfileConsumer
,
WebSSOProfileConsumerImpl
@Bean public org.springframework.security.saml.websso.WebSSOProfileConsumerHoKImpl hokWebSSOprofileConsumer()
WebSSOProfileConsumerHoKImpl
@Bean public org.springframework.security.saml.websso.WebSSOProfile webSSOprofile()
WebSSOProfile
,
WebSSOProfileImpl
@Bean public org.springframework.security.saml.websso.WebSSOProfileConsumerHoKImpl hokWebSSOProfile()
WebSSOProfileConsumerHoKImpl
@Bean public org.springframework.security.saml.websso.WebSSOProfileECPImpl ecpprofile()
WebSSOProfileECPImpl
@Bean public org.springframework.security.saml.websso.SingleLogoutProfile logoutProfile()
SingleLogoutProfile
,
SingleLogoutProfileImpl
@Bean public org.springframework.security.saml.key.KeyManager keyManager()
KeyManager
@Bean public org.springframework.security.saml.websso.WebSSOProfileOptions defaultWebSSOProfileOptions()
WebSSOProfileOptions
@Bean public org.springframework.security.saml.SAMLEntryPoint samlEntryPoint()
SAMLEntryPoint
@Bean public org.springframework.security.saml.metadata.ExtendedMetadata extendedMetadata()
ExtendedMetadata
@Bean public org.springframework.security.saml.SAMLDiscovery samlIDPDiscovery()
SAMLDiscovery
@Bean @Qualifier(value="idp-ssocircle") public org.springframework.security.saml.metadata.ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider(SAMLProperties properties) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
properties
- The SAML propertiesorg.opensaml.saml2.metadata.provider.MetadataProviderException
- On any configuration errorExtendedMetadataDelegate
,
HTTPMetadataProvider
@Bean @Qualifier(value="metadata") public org.springframework.security.saml.metadata.CachingMetadataManager metadata(org.springframework.security.saml.metadata.ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider) throws org.opensaml.saml2.metadata.provider.MetadataProviderException
ssoCircleExtendedMetadataProvider
- The extended metadata delegateorg.opensaml.saml2.metadata.provider.MetadataProviderException
- on any configuration errorCachingMetadataManager
@Bean public org.springframework.security.saml.metadata.MetadataGenerator metadataGenerator()
MetadataGenerator
@Bean public org.springframework.security.saml.metadata.MetadataDisplayFilter metadataDisplayFilter()
MetadataDisplayFilter
@Bean public org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler successRedirectHandler()
SavedRequestAwareAuthenticationSuccessHandler
@Bean public org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler authenticationFailureHandler()
SimpleUrlAuthenticationFailureHandler
@Bean public org.springframework.security.saml.SAMLWebSSOHoKProcessingFilter samlWebSSOHoKProcessingFilter() throws java.lang.Exception
java.lang.Exception
- For any configuration errorSAMLWebSSOHoKProcessingFilter
@Bean public org.springframework.security.saml.SAMLProcessingFilter samlWebSSOProcessingFilter() throws java.lang.Exception
java.lang.Exception
- on any configuration errorSAMLProcessingFilter
@Bean public org.springframework.security.saml.metadata.MetadataGeneratorFilter metadataGeneratorFilter()
@Bean public org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler successLogoutHandler()
SimpleUrlLogoutSuccessHandler
@Bean public org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler logoutHandler()
SecurityContextLogoutHandler
@Bean public org.springframework.security.saml.SAMLLogoutProcessingFilter samlLogoutProcessingFilter()
SAMLLogoutProcessingFilter
@Bean public org.springframework.security.saml.SAMLLogoutFilter samlLogoutFilter()
SAMLLogoutFilter
@Bean public org.springframework.security.saml.processor.HTTPArtifactBinding artifactBinding(org.opensaml.xml.parse.ParserPool parserPool, org.apache.velocity.app.VelocityEngine velocityEngine)
parserPool
- The parser pool to usevelocityEngine
- The velocity engine to useHTTPArtifactBinding
@Bean public org.springframework.security.saml.processor.HTTPSOAP11Binding soapBinding()
HTTPSOAP11Binding
@Bean public org.springframework.security.saml.processor.HTTPPostBinding httpPostBinding()
HTTPPostBinding
@Bean public org.springframework.security.saml.processor.HTTPRedirectDeflateBinding httpRedirectDeflateBinding()
HTTPRedirectDeflateBinding
@Bean public org.springframework.security.saml.processor.HTTPSOAP11Binding httpSOAP11Binding()
HTTPSOAP11Binding
@Bean public org.springframework.security.saml.processor.HTTPPAOS11Binding httpPAOS11Binding()
HTTPPAOS11Binding
@Bean public org.springframework.security.saml.processor.SAMLProcessorImpl processor()
SAMLProcessorImpl
@Bean public org.springframework.security.web.FilterChainProxy samlFilter() throws java.lang.Exception
java.lang.Exception
- on any configuration problemFilterChainProxy
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.Exception
configure
in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
http
- It allows configuring web based security for specific http requests.java.lang.Exception
- on any error