spring security AbstractAuthenticationProcessingFilter设置登录url404问题

突然设置的登录url失效,访问返回404错误

@Slf4j
public class GithubLoginAuthenticationFilter extends AbstractAuthenticationProcessingFilter {


protected GithubLoginAuthenticationFilter(String defaultFilterProcessesUrl) {
super(defaultFilterProcessesUrl);
}

protected GithubLoginAuthenticationFilter(RequestMatcher requiresAuthenticationRequestMatcher) {
super(requiresAuthenticationRequestMatcher);
}

public GithubLoginAuthenticationFilter() {
super(new AntPathRequestMatcher("/auth2/receive", "GET"));
}

原因:因为偷懒把权限 /auth2/** 路径设置到静态访问目录,导致直接访问到template-loader-path目录去了,不会进AbstractAuthenticationProcessingFilter过滤器,所以导致404。(没来得及看源码,后面补上)

# 放行静态资源
web.static.filtrate=/js/**,/css/**,/images/**,/fonts/**,/lib/**,/authority_error,/favicon.ico,/**.ico,/error,/api/v1/**, /auth2/**

解决方法:

把 /auth2/** 设置到匿名用户组里去 ROLE_ANONYMOUS 。

No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous