Google OAuth服务重定向到末尾带有#号的URL [英] Google OAuth service redirects to URL with a # sign at the end

查看:327
本文介绍了Google OAuth服务重定向到末尾带有#号的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过我们的使用Google登录"按钮将用户重定向到https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=[clientid]&redirect_uri=http://example.com/googleauth&scope=email时,导致重定向回网站的响应的Location标头末尾带有#符号:

When the user is redirected to https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=[clientid]&redirect_uri=http://example.com/googleauth&scope=email by our "Sign In with Google" button, the response's Location header that causes the redirection back to the site has a # symbol at the end:

响应标头:
位置: http://example.com/googleauth?code = [代码]#

它当然不会破坏网站的功能,但是无论如何我都希望摆脱它.我的初始请求URL是否有问题,还是我最终需要诉诸基于JavaScript的解决方案?

It certainly does not break the site's funcionality, but I'd like to get rid of it anyway. Is there something wrong with my initial request URL, or do I need to resort to a JavaScript based solution on my end?

推荐答案

您的重定向URL或客户端代码没有错.这是Google最近添加的内容,但您不必担心,也请参见: Google OAuth代码附加了额外的#" #添加到Google+ OAuth 2.0回调URL

There's nothing wrong with your redirect URL or client side code. This is something that Google recently added but should be of no concern to you, see also: Google OAuth code appends extra "#" in response and # added to Google+ OAuth 2.0 callback URL

这篇关于Google OAuth服务重定向到末尾带有#号的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆