I'm using OAuthToolkit and DjangoRestSwagger. I've created an application using Django Admin, and now I've client_id
and client_secret
.
I want to generate the token using client_id
and client_secret
. Currently, I use curl
to generate the token.
curl -X POST -d "grant_type=client_credentials" -u"client_id:client_secret" http://localhost:8000/o/token/
How can I do it using the Swagger docs.? Basically, how can integrate third party(OAuthToolkit) API URLs with Swagger?
Currently, I've an Authorize
button which takes api_key
value, ie the token.
Here's my Swagger settings.
SWAGGER_SETTINGS = {
'SECURITY_DEFINITIONS': {
'token': {
'type': 'apiKey',
'name': 'AUTHORIZATION',
'in': 'header',
}
},
}