We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm currently trying to get the Django REST framework integration working and get this when I access my API (using the browsable API):
HTTP 401 Unauthorized Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accept WWW-Authenticate: Bearer realm="api" { "detail": "Authentication credentials were not provided." }
Here's what the relevant (I think) sections in settings.py look like:
settings.py
INSTALLED_APPS = [ 'home.apps.HomeConfig', 'accounts.apps.AccountsConfig', 'api.apps.ApiConfig', 'django.contrib.admin', 'django.contrib.auth', 'mozilla_django_oidc', # Load after auth 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', ] AUTHENTICATION_BACKENDS = ( 'mozilla_django_oidc.auth.OIDCAuthenticationBackend', # Basic authentication backend that checks the Django users database and queries the built-in permissions # 'django.contrib.auth.backends.ModelBackend', ) REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'mozilla_django_oidc.contrib.drf.OIDCAuthentication', ), 'DEFAULT_PERMISSION_CLASSES': ( 'rest_framework.permissions.IsAuthenticated', ) }
Is there anything else that I should be configuring? Any help would be appreciated.
Also, for reference, using Python 3.6.5 with the following versions for Django, etc.:
Django==2.0.7 djangorestframework==3.8.2 mozilla-django-oidc==1.1.0
The text was updated successfully, but these errors were encountered:
I think I figured it out... need to use session authentication for the browsable API. Similar to this issue.
Sorry, something went wrong.
same issue how i can tickle this issue
same problem
Same Problem
No branches or pull requests
Hi, I'm currently trying to get the Django REST framework integration working and get this when I access my API (using the browsable API):
Here's what the relevant (I think) sections in
settings.py
look like:Is there anything else that I should be configuring? Any help would be appreciated.
Also, for reference, using Python 3.6.5 with the following versions for Django, etc.:
The text was updated successfully, but these errors were encountered: