wagnerdelima / drf-social-oauth2

drf-social-oauth2 makes it easy to integrate Django social authentication with major OAuth2 providers, i.e., Facebook, Twitter, Google, etc.
https://drf-social-oauth2.readthedocs.io/en/latest/
MIT License
274 stars 34 forks source link

Error access_denied: Your credentials aren't allowed #215

Open What-XD opened 7 months ago

What-XD commented 7 months ago

Describe the bug

When trying to get a JWT token via "convert-token" the response is an error "Your credentials aren't allowed"

To Reproduce

Send a request to receive a token on convert-token

Screenshots

image

Project

settings.py:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    # REST
    'rest_framework',

    # AUTH
    'oauth2_provider',
    'social_django',
    'drf_social_oauth2',
]

# AUTH

AUTH_USER_MODEL = 'account.CustomUser'

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
        'drf_social_oauth2.authentication.SocialAuthentication',
    ),
}

AUTHENTICATION_BACKENDS = (
    'social_core.backends.discord.DiscordOAuth2',
    'drf_social_oauth2.backends.DjangoOAuth2',
    'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_DISCORD_KEY = '***'
SOCIAL_AUTH_DISCORD_SECRET = '***'
SOCIAL_AUTH_DISCORD_SCOPE = ["identify", "email"]

ACTIVATE_JWT = True

Application DB: image

bojanKuzma commented 5 months ago

Does your account.CustomUser model by default have is_active as false, if that is the case that can happen.