@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");
 }
Beispiel #2
0
 @Override
 protected void configure(AuthenticationManagerBuilder auth) throws Exception {
   DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
   authenticationProvider.setUserDetailsService(userDetailsService());
   authenticationProvider.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
   auth.authenticationProvider(authenticationProvider);
 }
  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());
 }
 @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);
 }
 @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"));
   }
 }
 @Autowired
 public void configureGlobal(AuthenticationManagerBuilder authBuilder) throws Exception {
   authBuilder.authenticationProvider(datasourceAuthenticationProvider());
 }