pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.37k stars 3.01k forks source link

Facebook login issue SOCIALACCOUNT_PROVIDERS --> AUTH_PARAMS #3990

Closed ghilmanrandhawa closed 1 month ago

ghilmanrandhawa commented 1 month ago

Hi @pennersr ,

I'm facing an issue when I try to change the AUTH_PARAMS object from "auth_type": "reauthenticate" to "auth_type": "https" or "auth_type": "request".

Here are the configurations for the Facebook provider:

python Copy code

SOCIALACCOUNT_PROVIDERS = {
    'facebook': {
        'METHOD': 'oauth2',
        'SDK_URL': '//connect.facebook.net/{locale}/sdk.js',
        'SCOPE': ['email', 'public_profile'],
        'AUTH_PARAMS': {'auth_type': 'https'},
        'INIT_PARAMS': {'cookie': True},
        'FIELDS': [
            'id',
            'email',
            'name',
            'first_name',
            'last_name',
            'picture',
        ],
        'EXCHANGE_TOKEN': True,
        'VERIFIED_EMAIL': False,
        'VERSION': 'v19.0',
    }
}

I used reauthenticate to force the user to enter their password while logging in with Facebook.

Now, I don't want users to add their password again if they are already logged in during the session.

I've seen a couple of solutions, but they didn't work out. Please let me know if I'm missing something.

ghilmanrandhawa commented 1 month ago

@pennersr

pennersr commented 1 month ago

Now, I don't want users to add their password again if they are already logged in during the session.

"Logged in during the session"...where? Are you referring to your own project's sessions? If so, why would the user be logging in to FB again if (s)he is already logged in. Overall, I don't understand the scenario.

ghilmanrandhawa commented 1 month ago

Issue with Facebook Login:

If a user logs into their Facebook account with the same browser and then tries to log into my application using their Facebook account, my current Facebook provider settings require reauthentication. This forces the user to enter their password again when logging into my application with their Facebook account.

What I Want:

I want to change the configuration so that when a user logs into my application with their Facebook account, they are not asked to enter their password again. I have tried changing the settings to "rerequested" and "https," but this is not working.

Please let me know what I am doing wrong.

pennersr commented 1 month ago

Not asking for the password is the default, you don't need to deal with auth_type for that. All in all, this issue does not specifically point to a bug in allauth... converting to a discussion.