Я пытаюсь интегрировать параметр входа через Azure Active Directory с основным приложением. net. Я прошел через блоги Microsoft и прошел этапы, когда пользователь может войти в систему с учетной записью Microsoft. Но ПРОБЛЕМА
«Он всегда перенаправляет меня к методу действия входа». который возвращает меня к экрану входа.
Изображение для URL перенаправления: 
Мой класс запуска
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie()
.AddAzureAD(options => Configuration.Bind("AzureAd", options));
services.Configure<OpenIdConnectOptions>(AzureADDefaults.OpenIdScheme, options =>
{
options.Authority = options.Authority + "/v2.0/";
options.TokenValidationParameters.ValidateIssuer = false;
});
Моя учетная запись для входа контроллер
[HttpGet]
[AllowAnonymous]
public async Task<IActionResult> Login(string returnUrl)
{
if (User.Identity.IsAuthenticated)
return RedirectToAction("Index", "Search");
var domainInfo = await _subdomainProvider.GetDomainInfoAsync(Request.Host.Value);
if (domainInfo.LoginMethod == LoginMethod.AzureAD)
{
var redirectUrl = Url.Action("Index", "Search");
var properties = _signInManager
.ConfigureExternalAuthenticationProperties(LoginMethod.AzureAD.ToString(), redirectUrl);
return new ChallengeResult(LoginMethod.AzureAD.ToString(), properties);
}
else
{
ViewBag.ReturnUrl = returnUrl;
ViewBag.Background = await GetRandomBackgroundAsync(domainInfo.LoginBackgrounds);
}
return View(new LoginModel
{
Language = GetLanguage(),
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList()
});
}
Вид входа в систему
<form method="post" asp-controller="Account" asp-action="SignIn" asp-route-returnUrl="@Model.ReturnUrl">
<h2>@AccountStrings.Login_ExternalLogin_Title</h2>
<div>
@foreach (var provider in Model.ExternalLogins)
{
<button type="submit" class="btn login-provider @provider.DisplayName"
name="provider" value="@provider.Name"
title="Log in using your @provider.DisplayName account">
@provider.DisplayName
</button>
}
</div>
</form>
Даже добавлен URL-адрес перенаправления на портале azure для перенаправления в метод действия, т.е. dashboard.but по-прежнему не работает.
Любая помощь будет оценена. Спасибо.