OBO Auth Issue - AADSTS500133: Assertion is not within its valid time range

BasuAyusman-3102 6 Reputation points
2026-01-13T12:45:46.6966667+00:00

Not sure What else is missing or needs to be done! Any Help would be appreciated
Error:
AADSTS500133: Assertion is not within its valid time range. Ensure that the access token is not expired before using it for user assertion, or request a new token.

I have two Apps registered for my Azure WebApp that call Foundry agents using Python SDK and Streamlit UI which in turn connects to Fabric Data Agent. Had to go via this OBO route due to the following reason: https://community.fabric.microsoft.com/t5/Fabric-platform/Fabric-Data-Agent-inaccessible-from-Azure-WebApp-using-Foundry/m-p/4915477#M24463

Registered Apps:

  1. Auth App registration for Authentication code (for use by either MSAL or Easy Auth (Settings > Authentication > Add identity provider in the Web App resource)
  2. SDK App registration for the application (for use by body of code that is using the Azure SDK for Python). This is a SEPARATE app registration from the one used for authentication.

Auth App permissions: (SDK app has been provided user_impersonation delegate permission with Admin Consent among the API permissions in the Auth app.)
User's image

SDK App permissions:
User's image

When I tried debugging my code, I could see the following: Token Type (typ): JWT Algorithm (alg): RS256 Audience (aud): api://<SDK_appID> Issuer (iss): https://sts.windows.net/<tenant_id>/ App ID (appid): <Auth_appID> Token Version (ver): 1.0 Scopes (scp): user_impersonation It was able to give "Token audience matches: api://<SDK_appID>"

Referred the following: https://stackoverflow.com/questions/78525641/attempting-to-use-the-azure-web-app-identity-provider-feature-with-a-web-app-t

Microsoft Security | Microsoft Entra | Microsoft Entra ID

Your answer

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