Search code examples
securityoauth-2.0facebook-oauthspring-socialgoogle-oauth

Confirming user credentials in Facebook/Google OAuth2


Scenario: I have been developing a web application for management of small and medium-sized enterprises. Some time ago we used login and password authentication that were stored in our database. Nowadays when "everyone uses facebook" we moved to Facebook/Google OAuth2 authentication as well.

The problem is, there are some key operations that have to be especially secured (e.g. changing addresses, accessing clients' details). The best way to do this is I guess to ask users for retyping them credentials just before these risky operations are executed. But, since I use social authentication I can not confirm credentials anymore :(

Is there any way that I can force Facebook or other OAuth2 provider to re-ask users for credentials even they are already logged in?


Solution

  • I think this may be useful for someone.

    I have found such a credentials confirmation implemented on https://www.airbnb.com but only for facebook.

    AirBNB uses https://www.facebook.com/login/reauth.php as an authentication url

    Facebook re-authentication mechanism is described widely here:

    https://developers.facebook.com/docs/facebook-login/reauthentication

    For Google it is possible to force re-authentication by setting max_auth_age parameter to 0

    No prompt for re-authentication with OAUth2. Why and how to force it?