Open GrechkinDV opened 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
ACTIVATE_JWT = True DRFSO2_URL_NAMESPACE = "drf"
Have you got things like this?
yes
What's about your urls setup?
path('auth/', include('drf_social_oauth2.urls', namespace='drf')),
did you manage to get it to work?
Sorry about the delay. Did you manage to get this fixed? Can you paste more information about your problem?
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"
}
Turned out that I had traces of rest_framework_simplejwt all over my code base. Removing these helped solve my issue.
@GrechkinDV this is definitely not an error by drf-social-oauth2. That might be simplejwt as @denizdogan mentioned.
So does that mean there's no way to use both rest_framework_simplejwt and drf_social_oauth2
So I was able to fix my issue and use both rest_framework_simplejwt
and drf_social_oauth2
.
Authorization: Bearer <backend> <token>
Which doesn't work. I think this should be corrected to Authorization: Bearer <token>
as this is what works.SIMPLE_JWT = {
# other settings
"AUTH_HEADER_TYPES": ("JWT",),
}
So for rest_framework_simplejwt
I use Authorization: JWT <token>
and for drf_social_oauth2
, I use Authorization: Bearer <token>
.
ACTIVATE_JWT is set to True. Though, I still get only Bearer token after convert-token request.