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
9k stars 2.97k forks source link

Account provider not listed/visible #3773

Closed theabraxas closed 1 month ago

theabraxas commented 1 month ago

I have an issue where, when going to the login/sign-in page and seeing the 'or use a third-part' section, a provider is not listed. Specifically, no matter what I do, I cannot get google to show up. I've simplified my settings to show what's up and hopefully find what's wrong.

Here's the account providers config from my base.py:

SOCIALACCOUNT_PROVIDERS = {
    'discord': {
        'APP': {
            'client_id': SOCIAL_AUTH_DISCORD_KEY,
            'secret': SOCIAL_AUTH_DISCORD_SECRET,
        }
    },
    'google': {
        'APP': {
            'client_id': SOCIAL_AUTH_GOOGLE_OAUTH2_KEY,
            'key': SOCIAL_AUTH_GOOGLE_OAUTH2_KEY,
            'secret': SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET
        },
    }
}

Further, though I'm not sure it matters, here are the only other allauth settings:

# AllAuth Settings
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_AUTHENTICATION_METHOD = "username_email"
ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = True
SITE_ID = 1 # Required for AllAuth

Here are my INSTALL_APPS lines which are relevant:

    # AllAuth components
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.google',   
    'allauth.socialaccount.providers.discord',

Visually, this is what I see: image

Further, this is the view from the admin page when trying to add an application: image If I add facebook, gitlab, and others they show up on the dropdown but for some reason Google does not.

I am at a loss and would appreciate any ideas/insight! Thanks!

EDIT: @pennersr solved this below, and I just wanted to point out that some socialaccount providers do seem to work even if you don't install django-allauth[socialaccount], don't waste hours and hours like me digging when there is a simple fix!

pennersr commented 1 month ago

Did you install using pip install django-allauth[socialaccount] ?

pennersr commented 1 month ago

See https://github.com/pennersr/django-allauth/issues/3775#issuecomment-2084776523