hello.js icon indicating copy to clipboard operation
hello.js copied to clipboard

Cannot logout facebook properly.

Open jswxwxf opened this issue 12 years ago • 3 comments

hello.init({ facebook: 'app-id', }, { scope: 'basic, email', redirect_uri: 'redirect.html', display: 'page' } );

hello('facebook').login();

hello('facebook').logout({ force: true });

below is the url that generated to logout from facebook but does not work. https://www.facebook.com/logout.php?next=http%3A%2F%2Flocalhost%3A10200%2Fufn%2Fredirect.html%3Fcallback%3D_hellojs_cpm23efm%26result%3D%257B%2522force%2522%253Atrue%257D%26state%3D%257B%257D&access_token=CAAU6iZA2hRqkBABv4CRo7AMrwXUOzhRLJAgWW7bGvFriFJfT5GKKLDEgODsSaJOuNbmn8ZCwjtSMHhZBVySU7ailxkkyd2L5QdTpZCZCeXWrUl8Qy3d5vyfh4g2qDd2lQp3ZBexyEZBDg3JIM2dVZAcpnc0KqKdichTlsgPohS1dTxrwUOFuzZBJXwoiWPBjI2zrpmSQkW3G2R5bQ8ZA8qfvFo

but it's not working properly.

I've compared with the demo on website. the login url is using different version of facebook oauth. demo is using v1.0 instead of v2.1.

https://www.facebook.com/login.php?skip_api_login=1&api_key=1471737613076137&signed_next=1&next=https://www.facebook.com/v2.1/dialog/oauth?redirect_uri=http://localhost:10200/ufn/redirect.html&display=page&state={"client_id":1471737613076137,"network":"facebook","display":"page","callback":"hellojs_bvm7eyau","state":{"network":"facebook","request":{"oauth2_session_key":"8QihpER0QB2IoaREdNAdg","provider":"hp"},"authRequest":{"state":"dummy","clientId":"gcc_browser_client","devicePlatform":"Linux","deviceOsVersion":"23","deviceModel":"Chrome","claimedClientId":"gcc_browser_client","responseType":"token","deviceType":"B","enterprisePrefix":"hp","redirectUri":"urn:ietf:wg:oauth:2.0:oob","samlCodeAuthentication":false,"cacheExpiration":0,"stateobj":{}}},"redirect_uri":"http://localhost:10200/ufn/redirect.html","scope":"basic,email"}&scope=public_profile,email&response_type=token&client_id=1471737613076137&ret=login&cancel_uri=http://localhost:10200/ufn/redirect.html?error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied&state={"client_id": 'app-id',"network":"facebook","display":"page","callback":"hellojs_bvm7eyau","state":{"network":"facebook","request":{"oauth2_session_key":"8QihpER0QB2IoaREdNAdg","provider":"hp"},"authRequest":{"state":"dummy","clientId":"gcc_browser_client","devicePlatform":"Linux","deviceOsVersion":"23","deviceModel":"Chrome","claimedClientId":"gcc_browser_client","responseType":"token","deviceType":"B","enterprisePrefix":"hp","redirectUri":"urn:ietf:wg:oauth:2.0:oob","samlCodeAuthentication":false,"cacheExpiration":0,"stateobj":{}}},"redirect_uri":"http://localhost:10200/ufn/redirect.html","scope":"basic,email"}#=&display=page

https://www.facebook.com/login.php?skip_api_login=1&api_key=160981280706879&signed_next=1&next=https://www.facebook.com/v1.0/dialog/oauth?redirect_uri=http://adodson.com/hello.js/redirect.html&display=popup&state={"client_id":"160981280706879","network":"facebook","display":"popup","callback":"hellojs_coovv6ae","state":"","redirect_uri":"http://adodson.com/hello.js/redirect.html","scope":"basic"}&scope=public_profile&response_type=token&client_id=160981280706879&ret=login&cancel_uri=http://adodson.com/hello.js/redirect.html?error=access_denied&error_code=200&error_description=Permissions+error&error_reason=user_denied&state={"client_id":"160981280706879","network":"facebook","display":"popup","callback":"hellojs_coovv6ae","state":"","redirect_uri":"http://adodson.com/hello.js/redirect.html","scope":"basic"}#=&display=popup

I've decoded all of the url to let it easy to read.

jswxwxf avatar Nov 05 '14 07:11 jswxwxf

Does anyone face the same issue or have clue on it?

jswxwxf avatar Nov 05 '14 07:11 jswxwxf

+1 even I have the same problem..

raj2827 avatar Nov 05 '14 07:11 raj2827

Turns out, I need to add platform info to the facebook app, now logout is working properly. :)

jswxwxf avatar Nov 07 '14 07:11 jswxwxf