DEV Community


Discussion on: Secure and minimal APIs using .NET 6, C# 10 and Azure Active Directory

riccardo10 profile image

Nice article, Christos. Thanks.
One quick question, I am new to Azure AD (so please bear with me 😊).
With the code provided, how does Azure AD ensure automatic refreshing of tokens?

Thanks again.

christosmatskas profile image
Christos Matskas Author

Hey @riccardo , when you acquire an Access Token, you also get a Refresh Token that is responsible for getting a 'fresh" access token when your access token expires

riccardo10 profile image

Thanks for the response Christos.
I take it then that under the hood, the middleware (in collaboration with the identity platform) will manage the acquisition/disposal of access and refresh tokens in a seamless fashion, thereby allowing the UI to focus on business logic, yes?

Really amazing work you guys @ Microsoft are doing for the .NET developer community.

Thread Thread
riccardo10 profile image
Riccardo • Edited

Hi again Christos,
After watching some of your videos I can answer my last question now 😎
Yes, under the covers, the infrastructure handles token refresh and caching.

Thanks. 👍