django-rest-swagger icon indicating copy to clipboard operation
django-rest-swagger copied to clipboard

Swagger not setting token in Authorization header

Open yonatanlozinsky opened this issue 4 years ago • 2 comments

Hello, I just added swagger to my API and am wondering what I can change to stop getting 401's in every request I make through this interface.

I'm logging in successfully with DRF's basic login window.

Here are my SWAGGER_SETTINGS:

SWAGGER_SETTINGS = { 'JSON_EDITOR': True, 'USE_SESSION_AUTH': True, 'SECURITY_DEFINITIONS': { 'api_key': { 'type': 'apiKey', 'name': 'Authorization', 'in': 'header', } }, }

This is the response:

{"detail":"Authentication credentials were not provided."}

django-rest-swagger version: 2.2.0

I hope it's enough details. Thanks in advance!

yonatanlozinsky avatar Aug 19 '19 12:08 yonatanlozinsky

I had same question.If you know, can you tell me the answer?

ruanhailiang avatar Oct 09 '19 03:10 ruanhailiang

Same as #759 ?

wrvdklooster avatar Jan 03 '20 14:01 wrvdklooster