使用SpringSecurity6.2集成oauth2登录,登陆时gitee提示无效的登录回调地址。
原因:
跳转地址未编码,但是我把url编码后:http%3A%2F%2Flocalhost%3A8080%2Fapi%2Fauth%2Fsuccess配置到application.yml中时,访问地址会变成:http%253A%252F%252Flocalhost%253A8080%252Fapi%252Fauth%252Fsuccess,GPT分析结果是URL被双重编码了,还是没解决问题。
1.拉取代码:https://gitee.com/by-zero/spring-oauth2.git
2.配置gitee三方应用client-id、client-secret
3.启动程序并访问:http://localhost:8080/login