Чтобы использовать этого провайдера, мне нужно получить и передать код авторизации, возвращенный в результате перенаправления. Это тот момент, когда я не уверен, как получить этот код, хотя вижу, что он возвращается в браузере.
Код: Выделить всё
// Values from app registration
var clientId = "YOUR_CLIENT_ID";
var clientSecret = "YOUR_CLIENT_SECRET";
// For authorization code flow, the user signs into the Microsoft
// identity platform, and the browser is redirected back to your app
// with an authorization code in the query parameters
var authorizationCode = "HOW_DO_I_GET_THIS_CODE????";
// using Azure.Identity;
var options = new AuthorizationCodeCredentialOptions
{
AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,
};
// https://learn.microsoft.com/dotnet/api/azure.identity.authorizationcodecredential
var authCodeCredential = new AuthorizationCodeCredential(
tenantId, clientId, clientSecret, authorizationCode, options);
Подробнее здесь: https://stackoverflow.com/questions/793 ... credential
Мобильная версия