How to avoid "Token expired" errors on Azure built-in authentication (EasyAuth) with Google provider

Art 20 Reputation points
2025-02-13T09:50:39.4266667+00:00

I have a dynamic Web App deployed to Azure App Services, where I have enabled Azure built-in Authentication (EasyAuth) with Google as provider.

  • Token store is enabled
  • Scope: email, profile

Authentication works well, but after 1 hour (even if I am active working on the page), I get error: Token validation failed: Token expired

How can I prevent this from happening? I have read here about the need to activate refresh tokens using parameters consent=prompt and access_type=offline on the /.auth/login/google API Call. But from my code I don't make such a call, everything happens on Azure Authentication and I see no way to specify parameters.

Any workarounds? (e.g. refresh tokens on demand, etc).

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,297 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.