开发者

Remove AuthSub token from URL after redirect

When using AuthSub authentication, after the user logs into a Google service they are redirected back to the original page with a authentication token in the URL:

http://www.example.com/?token=XXXXXXXXXXXXXXXXXXX

Is i开发者_JAVA百科t possible to remove this token when the page is redirected?

Additionally, why isn't the success callback function being executed when the making this GET request (to the AuthSub page) with Jquery's $.get function?


Yes it is possible to remove the token. Just redirect the page after you've saved the token.

if (isset($_GET['token'])) {
    saveToken($_GET['token']);
    header('Location: /?displaySuccess=1');
    exit;
}

You need to redirect the client browser to the AuthSub page, because they need to sign in with their Google Account. Using an Ajax request won't work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜