boncey / Flickr4Java

Java API For Flickr. Fork of FlickrJ
BSD 2-Clause "Simplified" License
174 stars 155 forks source link

Remeber me isnt working with ldap spring security #715

Closed fadel09 closed 5 months ago

fadel09 commented 7 months ago

I am using spring security 5.7.11 and the following code

@Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
         auth. ldapAuthentication()
        .userSearchFilter(ldapUserSearchFilter)
        .userSearchBase(ldapUserSearchBase)
        .groupSearchBase(ldapGroupSearchBase)
        .groupSearchFilter(ldapGroupSearchFilter)
        .contextSource()
        .url(ldapUrl)
        .port(ldapPort)
        .managerDn(ldapManagerDn)
        .managerPassword(ldapManagerPassword);

        }

If i entered the user and the password it works however when I check remeber me checkbox it gives bad credentials.

     <input  type="checkbox" name ="remember-me">

and

@Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { return http.csrf().disable() .authorizeHttpRequests() .antMatchers("/login").permitAll() .antMatchers(staticResources).permitAll() .antMatchers("/**").authenticated() .and() .rememberMe().tokenValiditySeconds(86400) .and() .formLogin().loginPage("/login") .and().build() ; }