Forum Discussion

vcmirko's avatar
vcmirko
Occasional Visitor
3 years ago

authorize swagger basic authentication url to get token

Hi,

 

I built an api based on JWT with an access token and refresh token.

To get the token you first need to use my /api/v1/auth api, using basic authentication.

 

Can I (I have seen this before) have the swagger first "authorize" with the basic authentication, grab the token and then re-use it in the other api's.

I also have a /api/v1/token api to get new tokens with your refresh token.

 

So the authorize button should launch my /api/v1/auth api.

The result token should be cached and reused for all other api's

The refresh token should be cached an reused for my /api/v1/token api.

 

Can this be done ?  Then authorize button should only advertise the basic authentication, the rest should be done "under the hood".

No RepliesBe the first to reply