我在demo by java方法教程中尝试过它,它在那里工作过……但是这里面临的问题是它不能生成任何cookie……请帮助我,我尝试了大约3到4天……请帮助我,提前谢谢
这是checkbox name=“记住我”
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private JwtAuthenticationProvider jwtAuthenticationProvider;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/","/login","/new-pwd", "/fp","/cfp", "/fph","/terms-conditions").permitAll()
.anyRequest().authenticated()
.and()
.rememberMe()
.rememberMeParameter("remember-me")
.rememberMeCookieName("remember-me")
.tokenValiditySeconds(24 * 60 * 60)
.and().exceptionHandling().accessDeniedPage("/login")
.and().exceptionHandling().authenticationEntryPoint(new CognitoAuthenticationEntryPoint())
.and().addFilterBefore(new JWTLoginFilter("/doLogin", authenticationManager()), UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(new JWTAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception{
auth.authenticationProvider(jwtAuthenticationProvider);
}
@Override
public void configure(WebSecurity web) throws Exception {
web
.ignoring()
.antMatchers("/jwks.json","/jwks.json","/.pdf","/.pdf", "/terms-conditions","/resources/**", "/static/**", "/css/**", "/js/**", "/images/**","/resources/**", "/static/**", "/css/**", "/js/**", "/images/**");
}
}```
暂无答案!
目前还没有任何答案,快来回答吧!