2

Is there a way to trigger a reauthentication dialog using the facebook-android-sdk 3.0.1? It is possible using the JavaScript SDK (see https://developers.facebook.com/docs/facebook-login/reauthentication/), but I haven't found anything for the Android SDK.

The dialog should be triggered when the user wants to enter the "Edit my profile" section of the app.

Greeny
  • 1,931
  • 2
  • 17
  • 26

1 Answers1

0

I used something like this

Session session = Session.getActiveSession();
        if (session != null){
            session.closeAndClearTokenInformation();
            session = null;
            Log.i(TAG, "cleared session");
            Session.openActiveSession(activity, true, sessionCallback);
        }
5agado
  • 2,444
  • 2
  • 21
  • 30
  • With this code the session will be closed even if the user decides to cancel the re-authentication dialog? Is there any way to avoid this behaviour? – Greeny May 22 '13 at 07:27
  • Yes, but you can call this code only in the cases when you need this behavior. Besides the last line of code cause a new dialog to be shown, so remove it if you don't want it. – 5agado May 22 '13 at 09:40
  • So the Facebook session is still open if the re-authentication dialog is shown and the user cancels it?! I don't think so but this is a requirement :( – Greeny May 23 '13 at 06:59
  • In fact you will have a session with `SessionState` = CREATED. If the user cancel the dialog the session will not transits to the OPENED state. – 5agado May 23 '13 at 08:57