Examples of BCryptPasswordEncoder


Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

    @Inject
    private RememberMeServices rememberMeServices;<% } %>

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

    @EnableWebSecurity
    @Configuration
    static class PasswordEncoderConfig extends WebSecurityConfigurerAdapter {
        protected void configure(AuthenticationManagerBuilder auth) throws Exception {
            BCryptPasswordEncoder encoder = passwordEncoder();
            auth
                .inMemoryAuthentication()
                    .withUser("user").password(encoder.encode("password")).roles("USER").and()
                    .passwordEncoder(encoder);
        }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

        protected void configure(HttpSecurity http) throws Exception {
        }

        @Bean
        public BCryptPasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
        }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

    @EnableWebSecurity
    @Configuration
    static class PasswordEncoderNoAuthManagerLoadsConfig extends WebSecurityConfigurerAdapter {
        protected void configure(AuthenticationManagerBuilder auth) throws Exception {
            BCryptPasswordEncoder encoder = passwordEncoder();
            auth
                .inMemoryAuthentication()
                    .withUser("user").password(encoder.encode("password")).roles("USER").and()
                    .passwordEncoder(encoder);
        }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

                    .passwordEncoder(encoder);
        }

        @Bean
        public BCryptPasswordEncoder passwordEncoder() {
            return new BCryptPasswordEncoder();
        }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

        verify(encoder).matches(isA(String.class),  isA(String.class));
    }

    public void testUserNotFoundBCryptPasswordEncoder() {
        UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("missing", "koala");
        PasswordEncoder encoder =  new BCryptPasswordEncoder();
        DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
        provider.setHideUserNotFoundExceptions(false);
        provider.setPasswordEncoder(encoder);
        MockAuthenticationDaoUserrod userDetailsService = new MockAuthenticationDaoUserrod();
        userDetailsService.password = encoder.encode((CharSequence) token.getCredentials());
        provider.setUserDetailsService(userDetailsService);
        try {
            provider.authenticate(token);
            fail("Expected Exception");
        } catch(UsernameNotFoundException success) {}
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

     * deterministic and {@link #testUserNotFoundEncodesPassword()} ensures that SEC-2056 is fixed.
     */
    public void IGNOREtestSec2056() {
        UsernamePasswordAuthenticationToken foundUser = new UsernamePasswordAuthenticationToken("rod", "koala");
        UsernamePasswordAuthenticationToken notFoundUser = new UsernamePasswordAuthenticationToken("notFound", "koala");
        PasswordEncoder encoder = new BCryptPasswordEncoder(10,new SecureRandom());
        DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
        provider.setHideUserNotFoundExceptions(false);
        provider.setPasswordEncoder(encoder);
        MockAuthenticationDaoUserrod userDetailsService = new MockAuthenticationDaoUserrod();
        userDetailsService.password = encoder.encode((CharSequence) foundUser.getCredentials());
        provider.setUserDetailsService(userDetailsService);

        int sampleSize = 100;

        List<Long> userFoundTimes = new ArrayList<Long>(sampleSize);
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

    @Inject
    private RememberMeServices rememberMeServices;

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

    @Autowired
    private List<MetadataSetup> metadataSetups;

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
View Full Code Here

Examples of org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth, UserDetailsService userDetailsService) throws Exception {
        auth
            .userDetailsService(userDetailsService)
                .passwordEncoder(new BCryptPasswordEncoder());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.