Я использую Exchange 2019, ADFS 2019 и Windows Server 2022.< /p>
Вот ошибка вывода отладки в версии 2022
ОШИБКА => MSAL.Xamarin.Android.4.66.2.0.MsalServiceException:
ErrorCode:known_error
Microsoft.Identity.Client.MsalServiceException: ответ брокера возвратил ошибку: com.microsoft.identity.common.java.authorities.ActiveDirectoryFederationServicesAuthority не может быть отброшенным к com.microsoft.identity.common.java.authorities.AzureActiveDirectoryAuthority
at Microsoft.Identity.Client.Internal.Broker.BrokerInteractiveRequestComponent.ValidateResponseFromBroker(MsalTokenResponse msalTokenResponse)
at Microsoft.Identity.Client.Internal.Broker.BrokerInteractiveRequestComponent.FetchTokensAsync(CancellationToken cancelToken)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.FetchTokensFromBrokerAsync(StringbrokerInstallUrl, CancellationToken cancelToken)
at Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.GetTokenResponseAsync(CancellationToken cancelToken)
в Microsoft.Identity.Client.Internal.Requests.InteractiveRequest.ExecuteAsync(CancellationToken cancelToken)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.c__DisplayClass11_1.d.MoveNext()
Конец трассировки стека из предыдущего местоположения ---
в Microsoft.Identity.Client.Utils .StopwatchService.MeasureCodeBlockAsync(Func`1 codeBlock)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancelToken)
в Microsoft.Identity.Client.ApiConfig.Executors.PublicClientExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenInteractiveParameters activeParameters, CancellationToken cancelToken)
at RecipesApp.MainPage.OnLoginClicked(Object sender, EventArgs e) в C:\MyApp\MainPage.xaml.cs:line 28
StatusCode: 0
ResponseBody:
Заголовки:
Вот мой код
Код: Выделить всё
try
{
var publicClientApplicationBuilder = PublicClientApplicationBuilder
.Create("my_client_id_generated_from_adfs")
#if ANDROID || IOS
.WithBroker()
#endif
.WithAdfsAuthority("https://adfs.mydomain.com/adfs)
.WithRedirectUri($"msauth://com.test.app/my_encoded_base_64")
.Build();
var authResult = await publicClientApplicationBuilder.AcquireTokenInteractive({"email"})
.WithParentActivityOrWindow(EntraConfig.ParentWindow)
.ExecuteAsync().ConfigureAwait(false);
Debug.WriteLine($"SUCCESS => {authResult.AccessToken}");
Debug.WriteLine($"SUCCESS => {authResult}");
}
catch (Exception ex)
{
Debug.WriteLine($"====\nERROR => {ex}\n====");
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... -authority
Мобильная версия