Azure / azure-functions-microsoftgraph-extension

Microsoft Graph extension for Azure Functions
MIT License
46 stars 23 forks source link

Azure Function V2 Graph token- invalid_grant, Assertion is not within its valid time range #103

Open rajat1021 opened 5 years ago

rajat1021 commented 5 years ago

I am working on Azure function V2 Graph token template. I am getting below error if you don't use the system for a while. 2019-03-13T10:08:10.911 [Error] Executed 'Functions.GraphTest' (Failed, Id=ad2e8baf-6af7-4ac1-86f4-50bf8e936373) {"error":"invalid_grant","error_description":"AADSTS500133: Assertion is not within its valid time range.\r\nTrace ID: 225b4107-f46c-411d-ab13-9aead85cf600\r\nCorrelation ID: 59db5657-4510-4010-a2d4-fc07309c45cd\r\nTimestamp: 2019-03-13 10:08:10Z","error_codes":[500133],"timestamp":"2019-03-13 10:08:10Z","trace_id":"225b4107-f46c-411d-ab13-9aead85cf600","correlation_id":"59db5657-4510-4010-a2d4-fc07309c45cd"}

extensions.csproj

<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.AuthTokens" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.MicrosoftGraph" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.0.*" />

Please help me to solve this. As we want this to implemented in our most of the solutions

mjarmstrong commented 5 years ago

Also running into this issue.

nmanzi commented 5 years ago

Also having this issue. Occurs with Function configured for AAD Auth and token store enabled, using the token binding.

[FunctionName("GetESSLink")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, [Token(Resource="https://graph.microsoft.com", Identity=TokenIdentityMode.UserFromRequest)]string graphToken, ILogger log)