I am using below code to update custom extension claim attribute
but it is not working.
GraphServiceClient UpdateAsync()
method throwing error
var graphServiceClient = new GraphServiceClient(new DelegateAuthenticationProvider((requestMessage) =>
{
requestMessage.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", graphapitoken);
return Task.FromResult(0);
}));
var dictionary = new System.Collections.Generic.Dictionary<string, object>();
dictionary ["extension_clientid_moviename"] = "SampleValue";
await graphServiceClient.Users["[email protected]"] // here I'm getting error
.Request()
.UpdateAsync(new User()
{
AdditionalData = dictionary
});
Error:
Code: Request_ResourceNotFound\r\nMessage: Resource '[email protected]' does not exist or one of its queried reference-property objects are not present.
Update 1:
I have created extensions following below article.
I have used Powershell commands to create extensions
.
extension_clientid_moviename
is the extension name.
For guest users, you can not use their email to request a user, you should use their Object ID instead.
Also, you can add custom data to resources using extensions.
Update:
You need
User.ReadWrite.All permission
.Go to Azure portal->App registrations->your application->API permissions to check if you have added the permission and granted admin consent.