Package org.springframework.security.authentication.dao

Examples of org.springframework.security.authentication.dao.DaoAuthenticationProvider


    public final AuthenticationProvider buildDaoAuthenticationProvider(
            final UserDetailsService userDetailsService,
            final PasswordEncoder passwordEncoder,
            final SaltSourceService saltSource ) throws Exception {

        final DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
        provider.setUserDetailsService( userDetailsService );
        provider.setPasswordEncoder( passwordEncoder );
        provider.setSaltSource( saltSource );
        provider.afterPropertiesSet();
        return provider;
    }
View Full Code Here


    public final AuthenticationProvider buildDaoAuthenticationProvider(
            final UserDetailsService userDetailsService,
            final PasswordEncoder passwordEncoder,
            final SaltSourceService saltSource ) throws Exception {

        final DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
        provider.setUserDetailsService( userDetailsService );
        provider.setPasswordEncoder( passwordEncoder );
        provider.setSaltSource( saltSource );
        provider.afterPropertiesSet();
        return provider;
    }
View Full Code Here

                "  <authentication-provider>" +
                "    <jdbc-user-service cache-ref='userCache' data-source-ref='dataSource'/>" +
                "  </authentication-provider>" +
                "</authentication-manager>" + DATA_SOURCE + USER_CACHE_XML);
        ProviderManager mgr = (ProviderManager) appContext.getBean(BeanIds.AUTHENTICATION_MANAGER);
        DaoAuthenticationProvider provider = (DaoAuthenticationProvider) mgr.getProviders().get(0);
        assertSame(provider.getUserCache(), appContext.getBean("userCache"));
        provider.authenticate(new UsernamePasswordAuthenticationToken("rod","koala"));
        assertNotNull("Cache should contain user after authentication", provider.getUserCache().getUserFromCache("rod"));
    }
View Full Code Here

  }

  private UserDetails getUser() {
    ProviderManager parent = (ProviderManager) this.context
        .getBean(AuthenticationManager.class);
    DaoAuthenticationProvider provider = (DaoAuthenticationProvider) parent
        .getProviders().get(0);
    UserDetailsService service = (UserDetailsService) ReflectionTestUtils.getField(
        provider, "userDetailsService");
    UserDetails user = service.loadUserByUsername("user");
    return user;
View Full Code Here

                + upAuthConfig.getUserGroupServiceName());
        }
        userGroupServiceName = upAuthConfig.getUserGroupServiceName();
       
        //create delegate auth provider
        authProvider = new DaoAuthenticationProvider();
        authProvider.setUserDetailsService(ugService);
       
        //set up the password encoder
        // multiplex password encoder actually allows us to handle all types of passwords for
        // decoding purposes, regardless of whatever the current one used by the user group service
View Full Code Here

    }

    @Bean
    @Autowired
    public AuthenticationProvider authenticationProvider(UserDetailsService usersService) throws Exception {
        DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
        provider.setPasswordEncoder(new ShaPasswordEncoder());
        provider.setUserDetailsService(usersService);
        provider.afterPropertiesSet();
        return provider;
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.authentication.dao.DaoAuthenticationProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.