Swagger UI allows anyone - be it your development team or your end consumers - to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from your Swagger specification, with the visual documentation making it easy for back-end implementation and client-side consumption.
If you are using an OAuth2/OpenID compliant middleware with the implicit flow, you can configure the security definition directly in your Startup:
This is appropriate when your OAuth2 server has UI which you can redirect from.
If method #1 is not appropriate for you, but you do have access token then you can use the following code:
This way access token is asked to be passed with the request every time.