msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

[Client bug]: Error updating app registration with GB18030 character

Open zahalzel opened this issue 3 years ago • 7 comments

Describe the bug Creating an app registration and publishing to Azure, the URL of the published site contains a GB18030 character https://xn--msi20230725123842-o72vta.azurewebsites.net

Using the GraphServiceClient SDK to update an app registration with the following redirect URI: I am attempting to run PatchAsync() to update a Microsoft.Graph.Models.Application object. The code looks like this:

var updatedApp = await graphServiceClient.Applications[remoteApp.Id]. PatchAsync(appUpdates)

where appUpdates is a Microsoft.Graph.Models.Application object, the field causing the error is this string: "https://xn--msi20230725123842-o72vta.azurewebsites.net/signin-oidc"

which we want to add to the Application.Web.RedirectUris list

This call ends up throwing a Microsoft.Graph.Models.ODataErrors.ODataError exception, "One or more properties contains invalid values"

Related bug in Azure DevOps: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1860249/

Screenshots image

Client version Microsoft.Graph 5.25.0

zahalzel avatar Jul 26 '23 19:07 zahalzel

Thanks for raising this @zahalzel

Any chance you are able to share the other properties from the ServiceException i.e the request-id code and message to help understand the issue better?

andrueastman avatar Jul 27 '23 08:07 andrueastman

@andrueastman Here are some more details from the exception: Microsoft.Graph.ServiceException Code: Request_BadRequest Message: One or more properties contains invalid values. date: 2023-07-28T19:15:08 request-id: afa39607-09c8-496c-b006-a0173f7fbc89

zahalzel avatar Jul 28 '23 19:07 zahalzel

@andrueastman any updates on this one?

bribrothers avatar Sep 06 '23 18:09 bribrothers

@andrueastman this is currently a compliance issue for VS, do you have an update?

bribrothers avatar Sep 13 '23 19:09 bribrothers

@andrueastman Some more context on this, we are now using Microsoft.Graph version 5.25.0, so some of the code and the exception type has changed, but the issue is still unresolved.

I am attempting to run PatchAsync() to update a Microsoft.Graph.Models.Application object. The code looks like this:

var updatedApp = await graphServiceClient.Applications[remoteApp.Id]. PatchAsync(appUpdates)

where appUpdates is a Microsoft.Graph.Models.Application object.

The specific field that is causing an issue is the RedirectUris list, found in the Microsoft.Graph.Models.WebApplication here: https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/4c556b91c40bd1ff87500ce2916ade3ef11a79ed/src/Microsoft.Graph/Generated/Models/WebApplication.cs#L76

The element included in the list of RedirectUris is this: "https://xn--msi20230928124403-o72vta.azurewebsites.net/signin-oidc"

And the resulting exception is a Microsoft.Graph.Models.ODataErrors.ODataError, the Error message is as follows: "One or more properties contains invalid values."

image

zahalzel avatar Sep 28 '23 18:09 zahalzel

Following up via https://portal.microsofticm.com/imp/v3/incidents/details/428378536/home

andrueastman avatar Oct 02 '23 09:10 andrueastman

Closing this for now as the feedback is that the error is by design from the API side.

andrueastman avatar Nov 08 '23 09:11 andrueastman