I am trying to develop a web application using an interface with angular2 and a REST backend with spring loading.
I need to manage three types of authentication: - basic login / password for the re-database - ldap authentication - sso authentification
When the user is authenticated, the JWT generates a backend and sends it to the external interface. All requests must contain jwt in the header to communicate with REST.
Currently my websecurity configuration is:
@Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) @EnableTransactionManagement public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { private static final String LDAP_AUTHENTIFICATION = "ldap"; private static final String SSO_AUTHENTIFICATION = "sso"; @Autowired private DataBaseAuthentificationProvider authProvider; @Value("${ldap.provider.url}") private String ldapProviderUrl; @Value("${ldap.user.dn.patterns}") private String userDnPatterns; @Value("${authentification.type}") private String authentificationType; public WebSecurityConfiguration() { super(true); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { if (StringUtils.equals(authentificationType, LDAP_AUTHENTIFICATION)) {
Critical Point - SSO:
The behavior I would like is the following:
The client requests a secure REST resource:
- if the user is already registered in OpenAM => resource request back
- if the user is not registered yet => the user is redirected to OpenAM and provides its credentials => the user can access the resource
First, I enabled OpenAM on the virtual machine, created SAMLv2 providers, and got my idp.xml.
I am trying to use https://github.com/vdenotaris/spring-boot-security-saml-sample to add sso authentification, but it does not work.
Can anyone give me steps to integrate this into my websecurity configuration?
Thanks!
java spring-security single-sign-on openam
user2485349
source share