Я использую приведенный ниже код для обновления custom extension claim attribute
, но он не работает.
GraphServiceClient UpdateAsync()
ошибка метания метода
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["abcdxyz@hotmail.com"] // here I'm getting error
.Request()
.UpdateAsync(new User()
{
AdditionalData = dictionary
});
Ошибка:
Code: Request_ResourceNotFound\r\nMessage: Resource 'abcdxyz@hotmail.com' does not exist or one of its queried reference-property objects are not present.
Обновление 1:
Я создал расширения, следующие за статьей.
https://www.rahulpnath.com/blog/azure-ad-custom-attributes-and-optional-claims-from-an-asp-dot-net-application/
Я использовал команды Powershell для создания extensions
.
extension_clientid_moviename
- это расширение имени.