Hey,

I've setup mozilla-django-oidc, but I'm struggling to get 
`request.user.is_authenticated` to be true within DRF. I added a router 
endpoint to the browseable API:
return Response({"authenticated": request.user.is_authenticated()})

As well as a response outside DRF:
return HttpResponse(request.user.is_authenticated())

After authentication. DRF returns false, outside DRF returns true. 
mozilla-django-oidc even has a class extending DRF BasicAuthentication
https://github.com/mozilla/mozilla-django-oidc/blob/master/mozilla_django_oidc/contrib/drf.py

Which I added to the DRF settings:
REST_FRAMEWORK = {
    # ...
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'mozilla_django_oidc.contrib.drf.OIDCAuthentication',
    ]
}

This is all using 
Django 1.11.15, but I've tested with 2.2 as well.
djangorestframework==3.10.3

What am I missing to get a user seen as authenticated within DRF?

Thanks,
Eric

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/ea475eb9-4331-42e4-81cb-5bc523b8a2df%40googlegroups.com.

Reply via email to