0

I have seen a swagger UI with the Authorization button, which can get the user credentials, authorization flow, and client secrets then it will go and request the token from the auth server and use it in the next API calls. The UI is like this

enter image description here

I have used this approach in my ASP.net6 web API project (Swashbuckle.AspNetCore.SwaggerGen). But only manage to add a text box there to enter the bearer token, I have to get the Bearer token using a different mechanism. Can anyone help me to configure the swagger UI to something like above

Nlr
  • 183
  • 3
  • 13
  • check [this](https://www.c-sharpcorner.com/article/basic-authentication-in-swagger-open-api-net-5/). if you are using basic auth in API then you can use this mechanism. – CodingMytra Aug 22 '22 at 08:13
  • I found the answer in this post https://stackoverflow.com/questions/68122409/how-do-i-configure-swaggergen-with-openiddict-parameters-for-client-credentials – Nlr Aug 23 '22 at 08:00

0 Answers0