Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Oauth2 token authentication not recognized #110

@lggwettmann

Description

@lggwettmann
  • DRF OpenAPI version: newest
  • Python version: 3.6

I try to get a schema documentation for my django-oauth2-toolkit oauth2 authenticated app. DRF Open Api doesn't recognize the oauth2 token authentication but recognizes it as the Basic Django authentication. I need a proper schema.json file

These are my DRF settings:

REST_FRAMEWORK = {
    'DEFAULT_PERMISSION_CLASSES': [
        'rest_framework.permissions.IsAuthenticated',
    ],
    'DEFAULT_AUTHENTICATION_CLASSES': [
        'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
        # 'rest_framework.authentication.SessionAuthentication',
    ],
    'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.URLPathVersioning',
    'DEFAULT_VERSION': '0.1',
    'ALLOWED_VERSIONS': ['0.1'],
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
    'PAGE_SIZE': 100,
}

What did I do wrong or does DRF Open API just not recognize oauth2? How could I solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions