简体   繁体   English

Spring Social在重定向时丢失身份验证令牌

[英]Spring Social losing auth token on redirect

I'm trying to use Spring Social Facebook login along side form login, more or less following the guide here: http://www.baeldung.com/get-user-in-spring-security , only using header-based session management rather than cookies. 我正在尝试使用Spring Social Facebook登录以及侧面表单登录,或多或少遵循此处的指南: http : //www.baeldung.com/get-user-in-spring-security ,仅使用基于标头的会话管理而不是Cookie。 Right now the login is successful. 现在登录成功。 Facebook sends a 302 to my server at /api/signin/facebook , and my server sends a 302 to the post-sign-in url I've set on my ProviderSignInController along with the x-auth-token header. Facebook在/api/signin/facebook 302发送到我的服务器,而我的服务器将302x-auth-token标头一起发送到我在ProviderSignInController上设置的登录后URL。 The issue is that when following the last redirect my browser throws away the auth token. 问题是,在执行上次重定向后,我的浏览器会丢弃auth令牌。

I think I want to just add the auth token as a query param on the final redirect uri, but I don't know how to intercept the final response. 我想我只想将auth令牌作为查询参数添加到最终重定向uri上,但是我不知道如何拦截最终响应。 I've called setSignInInterceptors on my ProviderSignInController but that seems to be ignored after the first sign in. How can I keep my session information when it's not a cookie? 我叫setSignInInterceptorsProviderSignInController但似乎在第一符号之后被忽略。我怎样才能保持我的会话信息时,它不是一个cookie?

Just added the token as a query parameter and returned it from my custom SignInAdapter.signIn method. 刚刚将令牌添加为查询参数,并从我的自定义SignInAdapter.signIn方法返回了令牌。 I feel like there's probably a better solution but I needed something. 我觉得可能有更好的解决方案,但我需要一些东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM