Azure API Management - how to refresh access token backend API?
Asked Answered
A

1

6

I have created an API in Azure API Management to get data from a backend API. The backend API uses oAuth2 with an access token that expires in 10 minutes. With a returned refresh token you can get a new access token, which is again valid for another 10 minutes. And so on.

In the development portal of Azure APIM it is possible to do the authorization, which gives access for 10 minutes. After 10 minutes you have to do the authorization manually again, in order to get another 10 minutes access.

Is there a way in Azure APIM to automatically get a new access token, using the refresh token?

My goal is that the user does the authorization once manually in the development portal and after that the access token has to be refreshed automatically.

Amitosis answered 18/3, 2019 at 12:26 Comment(2)
Did you solve it? I've been trying to use the get-authorization-context policy but with no sucess tooUnfriended
Something like this perhaps? connectedcircuits.blog/2017/09/21/…Yahiya
D
0

Only manually through send-request policy. Could also use caching policies to keep token in cache and don't fetch a new one for every request.

Derosier answered 20/3, 2019 at 17:49 Comment(1)
Some sample code would not only improve this answer, it would also provide an answer the actual question.Epaminondas

© 2022 - 2024 — McMap. All rights reserved.