授权令牌值

时间:2012-07-13 06:39:20

标签: php oauth authorization

2 个答案:

答案 0 :(得分:1)

在服务器端,不发送url的hash参数。

所以,为了处理哈希部分,在上面的文件中,你可以通过javascript发送它:(下面的例子使用jQuery)

$(document).ready(function(){
    var auth=(window.location.hash.split('='))[1];
    $.ajax({
        url:'processing_php_file?token='+auth,
        success:function(response){
            //Processed.
        }
    });
});

OR

$(document).ready(function(){
    var auth=(window.location.hash.split('='))[1];
    window.location='processing_php_file?token='+auth;
});

然后,在处理文件中,您可以将此值作为$_GET['token']

来访问

答案 1 :(得分:-1)

在PHP中,您可以使用: parse_url($url, PHP_URL_FRAGMENT);

在javascript中: alert(window.location.hash);

相关问题