Swagger-Net and Bearer Token Authorization

308 Views Asked by At

We are using Swagger-Net with Bearer Token Authorization as follows:

c.ApiKey("Authorization", "header", "Bearer Token Authentication");

The request needs to be sent in the format "Bearer [bearertoken]", and I have verified this does work correctly when pasted in this format into the "API Key" authorization textbox. The Curl shows it being passed in the header as -H "Authorization: Bearer [token] and the API request succeeds.

Is there any way to automatically send a known token along with every API request? Or asked another way, is there any way to pre-fill this dynamically created API Key textbox with a known string to simplify the process for the end using testing our API?

0

There are 0 best solutions below