Ask a Question

swagger-editor, use token from a response to bearer token

RubenM55
Occasional Contributor

swagger-editor, use token from a response to bearer token

Hi community, I have a question that I cannot reply by myself, hope you can help me.

What I want to do is: 
I have a swagger with 3 API calls (API1, API2, API3). API1 requires user and password, and it returns a token and other information in the response. That token is used as a Bearer token auth for API2 and API3.
I want to pass the token replied for API1 automatically to API2 and API3 as a bearer token to skip the step where user copy and paste the token in the "Authorize" button.
This can be done? how?

Thanks a lot.

1 REPLY 1
ponelat
Staff

Hi @RubenM55 ,

 

There isn't any out-of-the-box solution that I know of -- to accomplish that.

One would need to create a custom plugin in Swagger UI. If you are interested in that, you can find some docs over here: https://github.com/swagger-api/swagger-ui/tree/master/docs

cancel
Showing results for 
Search instead for 
Did you mean: