예제 #1
0
 @Autowired
 public void config(AuthenticationManagerBuilder auth) throws Exception {
   auth.authenticationProvider(localDatabaseAuthenticationProvider);
   //
   // auth.inMemoryAuthentication().withUser("mohamed_waleed").password("123").roles("ADMIN","USER").and()
   //                .withUser("user2").password("1111").roles("ADMIN");
 }
예제 #2
0
 @Override
 protected void configure(AuthenticationManagerBuilder auth) throws Exception {
   DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
   authenticationProvider.setUserDetailsService(userDetailsService());
   authenticationProvider.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
   auth.authenticationProvider(authenticationProvider);
 }
예제 #3
0
  private void configureActiveDirectory(AuthenticationManagerBuilder auth) throws Exception {
    String domain = customProperties.getAdDomain();
    String url = customProperties.getAdUrl();
    if (domain != null) {
      ActiveDirectoryLdapAuthenticationProvider provider =
          new ActiveDirectoryLdapAuthenticationProvider(domain, url);
      provider.setUserDetailsContextMapper(userDetailsContextMapper());

      // Hm, this doesn't seem to have any effect, so handle the mapping in the
      // SeisoUserDetailsContextMapper.
      //			provider.setAuthoritiesMapper(grantedAuthoritiesMapper());

      auth.authenticationProvider(provider);
    }
  }
  @Override
  protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    // @formatter:off
    auth.inMemoryAuthentication()
        .withUser("user")
        .password(this.userPassword)
        .roles("USER")
        .and()
        .withUser("admin")
        .password(this.userPassword)
        .roles("USER", "ADMIN");

    auth.authenticationProvider(authenticationProviderBean());
    // @formatter:on
  }
 /**
  * Sets a custom authentication provider.
  *
  * @param auth SecurityBuilder used to create an AuthenticationManager.
  * @throws Exception
  */
 @Override
 protected void configure(AuthenticationManagerBuilder auth) throws Exception {
   auth.authenticationProvider(samlAuthenticationProvider());
 }
예제 #6
0
 @Autowired
 public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
   auth.authenticationProvider(cust);
   //	  auth.inMemoryAuthentication().withUser("user").password("user").roles("USER");
   //	  auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
 }
 @Override
 public void configure(AuthenticationManagerBuilder auth) throws Exception {
   auth.authenticationProvider(authenticationProvider);
 }
예제 #8
0
 @Autowired
 public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
   auth.userDetailsService(userDetailsService);
   auth.authenticationProvider(authenticationProvider());
 }
 @Override
 protected void configure(AuthenticationManagerBuilder auth) throws Exception {
   // auth.userDetailsService(dbUserDetailsService()).passwordEncoder(bcryptEncoder);
   auth.authenticationProvider(customAuthenticationProvider());
 }
 @Autowired
 protected void init(AuthenticationManagerBuilder builder) {
   if (!builder.isConfigured()) {
     builder.authenticationProvider(new AnonymousAuthenticationProvider("default"));
   }
 }
예제 #11
0
 @Autowired
 public void configureGlobal(AuthenticationManagerBuilder authBuilder) throws Exception {
   authBuilder.authenticationProvider(datasourceAuthenticationProvider());
 }