Google OAuth 服务重定向到 URL,末尾带有 # 符号

Google OAuth service redirects to URL with a # sign at the end

当用户通过我们的 "Sign In with Google" 按钮重定向到 https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=[clientid]&redirect_uri=http://example.com/googleauth&scope=email 时,导致重定向回站点的响应 Location header 有一个 #结尾的符号:

Response headers:
location: http://example.com/googleauth?code=[code]#

它当然不会破坏网站的功能,但我还是想摆脱它。我最初的请求 URL 有问题吗?还是我需要求助于基于 JavaScript 的解决方案?

您的重定向 URL 或客户端代码没有任何问题。这是 Google 最近添加的内容,但您应该不关心,另请参阅:Google OAuth code appends extra "#" in response and # added to Google+ OAuth 2.0 callback URL