Client assertion is not within its valid time range error while trying to acquire token from Azure client App

Venkat Kambhampati 1 Reputation point
2022-03-18T12:53:35.237+00:00

HI ,
I am trying to acquire token for from my Azure client App which has Ms Graph permissions set. I am using HttpClient request for acquiring the token. I am using client assertion and not client secrete. I am able to connect to the App using Connect-MgGraph commandlet from powershell.

But when I am trying to connect from C# application with JWT header and payload configured. I always get "unauthorized" error http response 401.

When I run from Postman app , I always get the same error even with a new self-signed certificate.

"error": "invalid_client",
"error_description": "AADSTS700024: Client assertion is not within its valid time range. Current time: 2022-03-18T11:28:52.5620799Z, expiry time of assertion 2022-03-15T11:56:47.0000000Z. Review the documentation at https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials .\r\nTrace ID: 8c1f2091-a4d3-47f3-8af3-d4d843842600\r\nCorrelation ID: e793dddb-745b-4636-8801-e23c3f00c7ff\r\nTimestamp: 2022-03-18 11:28:52Z",
"error_codes": [
700024
],
"timestamp": "2022-03-18 11:28:52Z",
"trace_id": "8c1f2091-a4d3-47f3-8af3-d4d843842600",
"correlation_id": "e793dddb-745b-4636-8801-e23c3f00c7ff",
"error_uri": "https://login.microsoftonline.com/error?code=700024"
}

It always shows expiry time is as "expiry time of assertion 2022-03-15" On march 15th 2022 I was able to get the access token successfully from postman app only, but from c# code I was getting "Unauthorized" error.

Even if I send empty client assertion and client id in postman app still it throws the same error as above. I am not able to come out of this error.

Hope I would get a solution for the problem in this forum.
Thank you,
Venkat K

Microsoft Security | Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Moustafa Ashmawy 6 Reputation points
    2022-08-25T19:05:05.497+00:00

    Have you ever managed to find out what was the cause of the above error and how to resolve it?

    1 person found this answer helpful.

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.