Shivaji Shitole, Thanks for the question. Apologies for the delayed response from over the weekend.
Based on my understanding of your scenario, you typically must write code to collect, store, and refresh these tokens in your application. With the token store, you just retrieve the tokens when you need them and tell App Service to refresh them when they become invalid. I understand you are leveraging Easy Auth.
As outlined in this doc, you may avoid token expiration by making a GET
call to the /.auth/refresh
endpoint of your application. When called, App Service automatically refreshes the access tokens in the token store for the authenticated user. Subsequent requests for tokens by your app code get the refreshed tokens. However, for token refresh to work, the token store must contain refresh tokens for your provider.
You may ensure that the application has an active access token by checking the expiration date of the token in the request header. The header name for the Microsoft identity provider is X-MS-TOKEN-AAD-EXPIRES-ON
.
Additionally, just to highlight, the OpenID Connect response type to use in the authentication flow. If not specified, a default is chosen based on the current configuration. If the Microsoft Entra (Azure AD) settings include a non-empty client-secret, then this defaults to code id_token. Otherwise, id_token is the default. Other combinations are not supported.
Check this article for more details.
Kindly let us know, I’ll follow with you further to understand more about your requirement and config.