microsoftgraph / microsoft-graph-devx-api

Services API for Graph Explorer
MIT License
88 stars 33 forks source link

AddTokenSigningCertificate DateTimeOffset UTC conversion problem #1113

Open JesperLeerberg opened 2 years ago

JesperLeerberg commented 2 years ago

Describe the bug The second parameter EndDateTime of the AddTokenSigningCertificate which is the type DateTimeOffset returns the following error: The 'endDateTime' parameter is not in correct format. It is expected to be UTC DateTime.

It seems that there is a conversion issue when calling the graph inside the SDK.

https://docs.microsoft.com/en-us/graph/api/serviceprincipal-addtokensigningcertificate?view=graph-rest-1.0&tabs=csharp

To Reproduce Steps to reproduce the behavior:

Try the example provided in the docs. This will produce the error.

var displayName = "CN=customDisplayName";

var endDateTime = DateTimeOffset.Parse("2024-01-25T00:00:00Z");

await graphClient.ServicePrincipals["{servicePrincipal-id}"] .AddTokenSigningCertificate(displayName,endDateTime) .Request() .PostAsync();

Expected behavior

HTTP/1.1 200 OK, with the response object.

Additional context Microsoft.Graph version 4.35.0

zengin commented 2 years ago

moving to the repository where we generate code snippets.