简体   繁体   中英

Show auth token on Swashbuckle UI

I've protected ASP NET Core WEB API 2.1 through IS4 (implicit flow). And now I need to document my API. I've decided to use swashbuckle and configured security here.

Thus, I have swashbuckle UI that can login user. As result of the login swashbuckle get authorization token and stores it somewhere internally (I wasn't able to find it in cookie or session etc.).

When I make request swashbuckle ui automatically attached this token to request (Authorization: Bearer tokenvalue), but I need to show the token somewhere on UI after user login. I'd like to give user possibility to enter token manually to each request instead of magic performed by swashbuckle.

So, is there a way to show the token on UI along with each endpoint?

The swashbuckle UI is a separate project ( Swagger-UI )
and you should see everything that is sent to the server in the curl section: 在此处输入图片说明



You also mentioned:

I'd like to give user possibility to enter token manually

There is no such an option, but you can put a request on the project, see what they have to say.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM