Oauth一直无限重定向
The Redirect Loop was because the /oauth2/authorization/ endpoint was secured, thus it was triggering going back to the Web API for an access token.
I've updated my configuration to this:
原因:// OAuth检测JSESSIONID登录;
//当OAuth 检测到是同一个浏览器已登录OAuth,发起请求时,不再返回code,直接返回access_token;
在第三方的项目 增加 返回access_token 的逻辑即可;
或者修改Oauth项目的相关配置;
@Configuration
public class SpotifySecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/home", "/login**","/callback/", "/webjars/**", "/error**", "/oauth2/authorization/**")
.permitAll()
.anyRequest()
.authenticated()
.and()
.oauth2Login();
}
}
参考:
https://stackoverflow.com/questions/57761917/spring-5-security-oauth2-login-redirect-loop
文章来源:刘俊涛的博客 欢迎关注公众号、留言、评论,一起学习。
__________________________________________________________________________________
若有帮助到您,欢迎点击推荐,您的支持是对我坚持最好的肯定(*^_^*)
你要保守你心,胜过保守一切。
本文来自博客园,作者:刘俊涛的博客,转载请注明原文链接:https://www.cnblogs.com/lovebing/p/15325482.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
2020-09-23 误删了python 文件夹导致无法卸载
2020-09-23 如何删除藏在电脑中的“红包助手”
2019-09-23 换手机号之前需要看看