Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 AuthSub 身份验证时,在用户登录 Google 服务后,他们将被重定向回原始页面,并在 URL 中使用身份验证令牌:
http://www.example.com/?token=XXXXXXXXXXXXXXXXXXX
重定向页面时是否可以删除此令牌?
此外,当使用 Jquery 的 $.get 函数发出这个 GET 请求(到 AuthSub 页面)时,为什么不执行成功回调函数?
是的,可以删除令牌。保存令牌后只需重定向页面。
if (isset($_GET['token'])) { saveToken($_GET['token']); header('Location: /?displaySuccess=1'); exit; }
您需要将客户端浏览器重定向到 AuthSub 页面,因为他们需要使用自己的 Google 帐户登录。使用 Ajax 请求将不起作用。