Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to force OAuth dialog to re-prompt the user for permissions even if already given

The facebook OAuth dialog redirects back to the provided redirect_uri without prompt if the user has previously approved access to the application and provided all permissions ...

I want to overwrite that behavior and force the dialog to ask the user again for permissions ...

wonder if this can be done, since the documentation provide no help on whether this is doable or not.

like image 304
Ahmad Nassri Avatar asked Sep 21 '11 02:09

Ahmad Nassri


3 Answers

I know this is an old post, but I just came across it and since I found the correct answer elsewhere, I thought I'd post it here.

You can send the auth_type=reauthorize.

AFAIK, auth_type has the following options: * reauthorize always has for permissions * rerequest for declined/revoked permissions * reauthenticate always as user to confirm password.

like image 82
prageeths Avatar answered Nov 01 '22 10:11

prageeths


As @Igy has already mentioned, you can revoke user access by issues DELETE request to me/permissions endpoint. The rest is simple:

FB.api('me/permissions', 'delete', function (r1) {
    // FB.login relies on FB.getLoginStatus.
    // Force reloading the login status.
    FB.getLoginStatus(function (r2) {
        FB.login(function (r3) {});
    }, true);
});
like image 45
Gajus Avatar answered Nov 01 '22 09:11

Gajus


Why would you want to do this? Getting users past the permissions stage is a critical step that often loses you a lot of traffic. When the pop up is shown, is managed completely by Facebook anyway, so it's not possible to ask someone to accept permissions when they have already done it. The only time they would see the request again is if they first revoke the permissions, or if your app increases the level of access being requested.

like image 39
Abby Avatar answered Nov 01 '22 10:11

Abby