public interface ServiceProviderConfigurer
EnableSAMLSSO and wanting to further customize the SAML Service
Provider using the DSL provided by ServiceProviderBuilder, which exposes most aspects of configuring
Spring Security SAML. Users of this interface are encouraged to use ServiceProviderConfigurerAdapter which
is the default implementation with empty methods, so users can choose which method to actually override.
The following is a basic example:
@Configuration
public static class MyServiceProviderConfig extends ServiceProviderConfigurerAdapter {
@Override
public void configure(ServiceProviderSecurityBuilder serviceProvider) throws Exception {
serviceProvider
.metadataGenerator()
.entityId("localhost-demo")
.and()
.sso()
.defaultSuccessURL("/home")
.idpSelectionPageUrl("/idpselection")
.and()
.logout()
.defaultTargetUrl("/")
.and()
.metadataManager()
.metadataLocations("classpath:/idp-ssocircle.xml")
.refreshCheckInterval(0)
.and()
.extendedMetadata()
.idpDiscoveryEnabled(true)
.and()
.keyManager()
.privateKeyDerLocation("classpath:/localhost.key.der")
.publicKeyPemLocation("classpath:/localhost.cert");
}
}
A different method of configuration exists through configuration properties exposed by SAMLSSOProperties.ServiceProviderConfigurerAdapter,
ServiceProviderBuilder,
EnableSAMLSSO,
SAMLSSOProperties| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
Allows for customization of the
HttpSecurity object exposed by WebSecurityConfigurerAdapter. |
void |
configure(ServiceProviderBuilder serviceProvider)
Allows for customization the SAML Service Provider.
|
void |
configure(org.springframework.security.config.annotation.web.builders.WebSecurity web)
Allows for customization of the
WebSecurity object exposed by WebSecurityConfigurerAdapter. |
void configure(ServiceProviderBuilder serviceProvider) throws Exception
serviceProvider argument exposes a bunch
of configurers with options to fully customize Spring Security SAML through a DSL-like configuration.
A different method of configuration exists through configuration properties exposed by SAMLSSOProperties.serviceProvider - Exception - Any exception coming from WebSecurityConfigurerAdapter.SAMLSSOPropertiesvoid configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
throws Exception
HttpSecurity object exposed by WebSecurityConfigurerAdapter.http - the HttpSecurity object.Exception - Any exception coming from WebSecurityConfigurerAdapter.void configure(org.springframework.security.config.annotation.web.builders.WebSecurity web)
WebSecurity object exposed by WebSecurityConfigurerAdapter.web - the WebSecurity object.Exception - Any exception coming from WebSecurityConfigurerAdapter.Copyright © 2018. All rights reserved.