Facebook 返回#access_token
我正在使用 Java Scribe + Spring MVC 来访问 Facebook 身份验证 API。
但是,我从 Facebook 获取的带有访问令牌的 URL 的格式如下:
/facebookCallback#access_token=[long chunk]&expires_in=5028
如您所见,access_token 前面有一个 #,这不允许我将 access_code 作为普通参数获取。
Facebook 附加 # 而不是 是否有任何原因?
I am using Java Scribe + Spring MVC to access Facebook authentication API.
However, the URL with the access token I am getting back from Facebook is in this format:
/facebookCallback#access_token=[long chunk]&expires_in=5028
As you can see, the access_token is preceded by a #, which disallows me from obtaining the access_code as a normal parameter.
Is there any reason why Facebook is appending the # instead of a ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为您指的是 Javascript,而不是 Java Scribe?
I think you mean Javascript , and not Java Scribe ?
您可能正在使用为 JS 库设计的回调参数。确保您没有发送错误的“类型”参数。
you are probably using the callback parameter which is designed for the JS library. Make sure you are not sending an incorrect parameter for "type".
事实证明,这可能是我学校网络造成的。我在学校和家里尝试了完全相同的代码,但得到了不同的结果(学校 - 错误,家庭 - 正确)。
第二天在学校问题就自行解决了,所以我无法找出确切的原因。感谢那些提供帮助的人。
Turns out that it probably was caused by my school network. I tried the exact same code both in school and at home and got different results (school - error, home - correct).
The problem solved by itself the next day in school so I won't be able to find out exactly why. Thanks to those who helped.