0

settings.py

'DEFAULT_AUTHENTICATION_CLASSES': [
        'rest_framework_simplejwt.authentication.JWTAuthentication',
    ],

views.py

from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
   openapi.Info(
      title="接口文档",
      default_version='v1',
      description="使用youtube-dl 下载视频",
      contact=openapi.Contact(email="wh970305@163.com"),
   ),
   public=True,

)

then the API return Authentication credentials were not provided. because the token is wrong

curl -X GET "http://localhost:8000/api/auth/info" -H  "accept: application/json" -H  "authorization: Basic YWRtaW46MTIzNDU2" -H  "X-CSRFToken: TQ31NEGiMUJVUvqJKVKyua1hWgmHP614t0skwPqxQT0JvUR8PMqzXgIqAKzcgEhW"

1 Answers1

0

Try this way: Authorization: Bearer JWT_ACCESS_TOKEN

Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
Muller
  • 76
  • 4