@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Import(value=SAMLServiceProviderSecurityConfiguration.class) public @interface EnableSAMLSSO
ServiceProviderConfigurer for customization
of the Service Provider, a java DSL that resembles the configuration style of WebSecurityConfigurer and it
provides one adapter with empty implementations, ServiceProviderConfigurerAdapter which is the preferable
class that users of this plugin will extend to customize the service provider. 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");
}
}
Also, most simple configurations could be accomplished without the use of this DSL, by just simply configuring
the appropriate properties exposed by SAMLSSOProperties on application.properties, application.yml or any
other Property Source.
ServiceProviderConfigurerAdapter,
ServiceProviderConfigurer,
SAMLServiceProviderSecurityConfiguration,
SAMLSSOPropertiesCopyright © 2018. All rights reserved.