
net.smartcosmos.extension.stormpath.config.ServiceUserAccessSecurityConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smartcosmos-user-details-stormpath Show documentation
Show all versions of smartcosmos-user-details-stormpath Show documentation
Retrieves User Detail Information for use in Authentication from Stormpath
The newest version!
package net.smartcosmos.extension.stormpath.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import net.smartcosmos.extension.stormpath.auth.provider.ServiceUserAccessAuthenticationProvider;
@Configuration
@Order(2)
@EnableConfigurationProperties(ServiceUserProperties.class)
public class ServiceUserAccessSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private ServiceUserAccessAuthenticationProvider serviceUserAccessAuthenticationProvider;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(serviceUserAccessAuthenticationProvider);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http // @formatter:off
.csrf()
.disable()
.authorizeRequests()
.antMatchers("/authenticate/**").authenticated()
.anyRequest().authenticated()
.and()
.httpBasic();
// @formatter:on
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy