I'm trying to use Swashbuckle 5.0.x with OAuth2. I want to use OAuth2's Resource Owner Password Credentials Grant. I basically only want to ask for a token first and include this token in each request (e.g. no need for scopes).
Can anyone help with this? How do I have to configure swagger/swashbuckle?
i had a problem where the solution .InjectJavaScript() resolved my problem, the diference is that i have a custom grant type, since the base code of swagger-ui-min.js have the grant password hardcoded for the flow password, the solution was override their code:
The (...) have the original code that i copy from the swagger-ui-min.js.
OK, I solved it like this:
Add a JavaScript completion-handler to swagger:
Take username:password from the API_KEY textbox:
Thank you @Dunken. Your answer almost solve my problem, but to make it work with latest Swashbuckle version I had to change it a bit like this