spring-social - Spring OAuth2 将原始请求保存在会话中并重定向到原始 URL
问题描述
这是安全配置
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.formLogin()
.disable()
.httpBasic()
.disable()
.authorizeRequests()
.antMatchers("/auth/**", "/oauth2/**")
.permitAll()
.anyRequest()
.authenticated()
.and()
.oauth2Login()
.authorizationEndpoint()
.baseUri("/oauth2/authorize")
.and()
.redirectionEndpoint()
.baseUri("/oauth2/callback/*")
.and()
.userInfoEndpoint()
.userService(customOAuth2UserService)
.and()
.successHandler(oAuth2AuthenticationSuccessHandler)
.failureHandler(oAuth2AuthenticationFailureHandler);
}
在前端,URL 是http://localhost:8080/oauth2/authorize/google?redirect_uri=http://localhost:8080/some-url
但是,在用户获得授权并成功登录后,用户不会被重定向到http://localhost:8080/some-url
可能是什么原因以及如何解决?
解决方案
推荐阅读
- xslt - wix xsl 转换以有条件地删除组件
- laravel-5 - 为表单字段添加观察者
- qt - QJsonValue 是否将数字字符串与整数不同?
- spring-boot - Springboot - 包括 JPA 依赖项并运行“mvn clean install”失败并出现 HikariPool-1 - 池初始化期间出现异常
- http - 获取 java.net.SocketException:连接重置,在 Apache 骆驼路由中进行 http4 调用期间
- java-8 - 为什么一次调用会执行两次 Observable 功能?
- c++ - 解析器如何处理预处理器和条件编译?
- apache - 我可以将 Apache 重写存储在 Web 根目录中的 .htaccess 的单独文件中吗?
- android - CardView 阴影未显示
- react-native - React Native:如何使用 react-native 导航在 bottomTabs 中实现 topTabs