Reputation: 1642
How can I add JWT as an authentication for Swagger? Here is my Swagger Settings:
SWAGGER_SETTINGS = {
"SECURITY_DEFINITIONS": {
"JWT": {
"name": "Authorization",
"description": "JWT authorization",
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT",
"in": "header",
}
},
"USE_SESSION_AUTH": False,
}
I get
Unknown security definition type http
Upvotes: 1
Views: 911
Reputation: 63
this works for me:
SWAGGER_SETTINGS = {
'SECURITY_DEFINITIONS': {
"Auth Token eg [Bearer {JWT}]": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}
Upvotes: 1