English 中文(简体)
书本认证 PHP
原标题:Facebook api authentication PHP

在我的网站上,“Im”用Facebook API进行认证。

<fb:login-button onlogin="fbLoginEvent(arguments)">Enter with Facebook</fb:login-button>

我的职能是:

function fbLoginEvent( args ) {
    //console.log( "fbLogin", args );
    //var session = FB.getSession();
    var session = FB.getAuthResponse();
    if (session) {
        fbCheckSession(session, function(data) {
            if (data.result) {
            fbLoginNow();
    } else {                        
            $( #facebook-register ).data("overlay").load();

    }
         });
}
}

我的职责是检查本届会议:

var fbLogin = { status: false, uid: 0, access_token: "" };

function fbCheckSession( session, callback ) {
    if ( session && $.type(callback) == "function" ) {
    ajaxCall( "facebook", "check_session", {uid: session.uid, token: session.access_token}, function(data){
        if ( data.result ) {
        fbLogin.status = true;
        fbLogin.fbuid = session.uid;
        fbLogin.uid = data.info.id;
        fbLogin.access_token = session.access_token;
            callback( { result: true, info: { name: data.info.name, fbLogin: fbLogin } } );
            } else {
        callback( { result: false } );
            }
    });
}                   
}

I made ​​various checks and I have noticed that uid and tokens value are empty. Any solution? Thk

问题回答

页: 1

用途

var session = FB.getAuthResponse();

var session = FB.getAuthResponse

页: 1 使用与FB.get CarloinStatus。 未按先前版本的JS-SDK回归格式的getSession回归。

userID和access_token>。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签