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
276 stars 34 forks source link

Hi, everyone. Can't get JWT Token #57

Open GrechkinDV opened 3 years ago

GrechkinDV commented 3 years ago

ACTIVATE_JWT is set to True. Though, I still get only Bearer token after convert-token request.

vipinmohan22 commented 3 years ago

ACTIVATE_JWT is set to True. Though, I still get only Bearer token after convert-token request. Same here. I've been pulling my hair out due to this

GrechkinDV commented 3 years ago

Social Oauth

ACTIVATE_JWT = True DRFSO2_URL_NAMESPACE = "drf"

Have you got things like this?

vipinmohan22 commented 3 years ago

yes

GrechkinDV commented 3 years ago

What's about your urls setup?

vipinmohan22 commented 3 years ago
path('auth/', include('drf_social_oauth2.urls', namespace='drf')),

did you manage to get it to work?

wagnerdelima commented 2 years ago

Sorry about the delay. Did you manage to get this fixed? Can you paste more information about your problem?

denizdogan commented 2 years ago

I do get a JWT, but I have no idea how to use it in my client.

When I try this:

Authorization: Bearer eyJhbGci...

I get this:

{
    "detail": "Given token not valid for any token type",
    "code": "token_not_valid",
    "messages": [
        {
            "token_class": "AccessToken",
            "token_type": "access",
            "message": "Token has no 'exp' claim"
        }
    ]
}

When I do this:

Authorization: Bearer facebook eyJhbGci...

I get this:

{
    "detail": "Authorization header must contain two space-delimited values",
    "code": "bad_authorization_header"
}
denizdogan commented 2 years ago

Turned out that I had traces of rest_framework_simplejwt all over my code base. Removing these helped solve my issue.

wagnerdelima commented 2 years ago

@GrechkinDV this is definitely not an error by drf-social-oauth2. That might be simplejwt as @denizdogan mentioned.

codewitgabi commented 9 months ago

So does that mean there's no way to use both rest_framework_simplejwt and drf_social_oauth2

codewitgabi commented 9 months ago

So I was able to fix my issue and use both rest_framework_simplejwt and drf_social_oauth2.

So for rest_framework_simplejwt I use Authorization: JWT <token> and for drf_social_oauth2, I use Authorization: Bearer <token>.