Spring Security 401未经许可甚至未经许可

Spring Security 401未经许可甚至未经许可,第1张

Spring Security 401未经许可甚至未经许可

我有同样的问题,不确定,但我认为您需要以下命令

@Overrideprotected void configure(HttpSecurity http) throws Exception {    http .authorizeRequests() .antMatchers(HttpMethod.POST, "/api/auth*.png",         "*.gif",         "*.svg",         "*.jpg",         "*.html",         "*.css",         "*.js") .permitAll()         .anyRequest() .authenticated() .and() .cors() .and() .exceptionHandling() .authenticationEntryPoint(this.jwtAuthenticationEntryPoint) .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .csrf() .disable();    // Add our custom JWT security filter    http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5024120.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存