July 2018
Intermediate to advanced
268 pages
7h 36m
English
Now, we will change (or rather, configure) our Spring Security configuration files, as follows:
@EnableWebSecurity@Configuration@EnableGlobalMethodSecurity(securedEnabled = true)public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { @Value("${security.saml2.metadata-url}") String metadataUrl; @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/saml/**").permitAll() .anyRequest().authenticated() .and() .apply(saml()) .serviceProvider() .keyStore() .storeFilePath("saml/keystore.jks") .password("secret") .keyname("spring") .keyPassword("secret") .and() .protocol("https") .hostname("localhost:8443") .basePath("/") .and() .identityProvider() ...Read now
Unlock full access