Why django-social-auth in djoser don't find client_id in authorization_url if client_id is provided

69 views Asked by At

Why django-social-auth in djoser don't find client_id in authorization_url if client_id is provided

I trying authenticate user with djoser + django-social-auth(front: Vue, back: django). When I request to http://127.0.0.1:8000/auth/o/google-oauth2?redirect_uri=http://localhost:8080, url response with client_id=None in authorization_url. Here are my settings and response.

AUTHENTICATION_BACKENDS = [
    'fapp.auth_backend.AuthWithEmailAndPasswordOnly',
    'social_core.backends.google.GoogleOAuth2',
]
DJOSER = {
    'PASSWORD_RESET_CONFIRM_URL': '#/password/reset/confirm/{uid}/{token}',
    'USERNAME_RESET_CONFIRM_URL': '#/username/reset/confirm/{uid}/{token}',
    'ACTIVATION_URL': '#/activate/{uid}/{token}',
    'SOCIAL_AUTH_ALLOWED_REDIRECT_URIS': [
        'http://localhost:8080',
        'http://localhost:8000'
    ],
    'SOCIAL_AUTH_GOOGLE_OAUTH2_CLIENT_ID': '***'
}

And response

"authorization_url": "https://accounts.google.com/o/oauth2/auth?client_id=None&redirect_uri=http://localhost:8080&state=dpcVJ92tDbxvxMvmn4m3wiCOTw5b0Pcx&response_type=code&scope=openid+email+profile"

After this response I tried go to authorization_url with changed client_id to SOCIAL_AUTH_GOOGLE_OAUTH2_CLIENT_ID and it's work fine.

0

There are 0 answers