Код: Выделить всё
var authProvider = new DelegateAuthenticationProvider(async (request) => {
// Use Microsoft.Identity.Client to retrieve token
var assertion = new UserAssertion(token.AccessToken);
var result = await clientApplication.AcquireTokenOnBehalfOf(scopes, assertion).ExecuteAsync();
request.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", result.AccessToken);
});
Подробнее здесь: https://stackoverflow.com/questions/756 ... soft-graph
Мобильная версия