У меня есть проект сервера удостоверений, над которым я работаю, по какой-то причине в качестве URL-адреса для выхода задано значение NULL.Используя функцию «BuildLogoutViewModelAsync (logoutId)», найденную в QuickStart, эта строка возвращает ноль, но в журнале «post_logout_redirect_uri» установлена и установлена правильно.
var context = await this.interactionService.GetLogoutContextAsync(logoutId);
Вот необходимая информация отфайл журнала.
2018-06-11T16:11:27.1301566-04:00 0HLEFQTLST4A2:00000006 [INF] Profile service returned to the following claim types: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress name given_name email UserId PayeeId ErpPayeeId MyReports PipelineCRM Start Start IdentityManager SpecialOrder MarketingEmail PunchOut CustomerEntityManager AttributeManager SpecialOrdersLite PayeeManagement VirtualVideoTraining MySurveys NAMToolkit Dashboard FrameworkManager FrameworkManager ContractManagement SalesDashboard HRSInstallationLeadForm PunchoutManagement CompetitiveIntelligence SpecialOrderRequest LuceneIndexSearch CompetitiveIntelligence PKB CompetitiveIntelligence CompetitiveIntelligence CompetitiveIntelligence PKB SpecialOrderRequestPOC AppsManagement Genie Testing1234 October Deviation ReportDeliveryManagement ReportDeliveryManagement RgTest TestingUpdates1 TrainingDemo ABCDE CustomerSegmentationManager CustomerSegmentationManager TestingTemplate2 AppsMgmt AppsMgmt AppsMgmt InventoryControlWorkflow ProPurchaseCardMaint" (a9217bec)
2018-06-11T16:11:27.1354674-04:00 0HLEFQTLST4A2:00000006 [INF] Request finished in 1263.2834ms 200 application/json; charset=UTF-8 (791a596a)
2018-06-11T16:11:29.9711755-04:00 0HLEFQTLST4A1:00000007 [INF] Request starting HTTP/1.1 GET http://localhost:44329/connect/endsession?post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A21402%2Fsignout-callback-oidc&state=CfDJ8A54aiN-IdtIpcL6PAgpJbMSpzMkkd27BJqnGFbTgRwiqdf1XkpfMApJnfC0_3BOsVALgr2skPwBmy74ToICvY6ZjWsd4BJLHkVqJD9Cp45zXBKH37iX2o2y6A8wD30yghQDcA4B2iPHg6eAjliWN4h8jv3PdlE_gjIKiNY-Eckk&x-client-SKU=ID_NET&x-client-ver=2.1.4.0 (ca22a1cb)
2018-06-11T16:11:29.9738375-04:00 0HLEFQTLST4A1:00000007 [INF] AuthenticationScheme: "idsrv" was successfully authenticated. (1805f3b3)
2018-06-11T16:11:29.9759119-04:00 0HLEFQTLST4A1:00000007 [INF] AuthenticationScheme: "idsrv" was successfully authenticated. (1805f3b3)
2018-06-11T16:11:29.9796082-04:00 0HLEFQTLST4A1:00000007 [INF] Invoking IdentityServer endpoint: "IdentityServer4.Endpoints.EndSessionEndpoint" for "/connect/endsession" (f7642de5)
2018-06-11T16:11:29.9963239-04:00 0HLEFQTLST4A1:00000007 [INF] End session request validation success
"{
\"SubjectId\": \"MOORESTOWN\\rpannell1\",
\"Raw\": {
\"post_logout_redirect_uri\": \"http://localhost:21402/signout-callback-oidc\",
\"state\": \"CfDJ8A54aiN-IdtIpcL6PAgpJbMSpzMkkd27BJqnGFbTgRwiqdf1XkpfMApJnfC0_3BOsVALgr2skPwBmy74ToICvY6ZjWsd4BJLHkVqJD9Cp45zXBKH37iX2o2y6A8wD30yghQDcA4B2iPHg6eAjliWN4h8jv3PdlE_gjIKiNY-Eckk\",
\"x-client-SKU\": \"ID_NET\",
\"x-client-ver\": \"2.1.4.0\"
}
}" (8a893fca)
2018-06-11T16:11:30.0114218-04:00 0HLEFQTLST4A1:00000007 [INF] Request finished in 40.0686ms 302 (791a596a)
2018-06-11T16:11:30.0233725-04:00 0HLEFQTLST4A2:00000007 [INF] Request starting HTTP/1.1 GET http://localhost:44329/account/logout?logoutId=CfDJ8Lr1ecTh1x5IjvA0NxR18eixqgY1PROntfeC5wQJbnQmhM8qTPkm3Dt4ckYZ5sm1NFGrcOh2t67DG6X5buzj8klwDUz8rXzYBIFoTpxIKk4Zi-BhQIimvGKeukPMtgodz16q47X8PTqvaq0TIPLNPvl-QEh54ZZBafc9lk0amvlttW4CPfGGwoCpUJV_vwt9n6B7uu4_WEKaX65qF8O0vu7f-i-IZ_up2T19USJoZMSmy5uRo7-ZpReWgMfB6Ym2jOrWYA2KQBlKgczfmAWyj7eGbz0jRXecCbgcqwIVfVHsgWGL4-DdvM44YG7mp7-AvJAQ1ZOeLT2ootHcwt_ulYNb_zsy-OCT-XdblPBGAXuLqzuTuvEpbkUnF0cE2Amltwmq_ZWc89GK9QG_Ectubzl23k3S0oJ0AjHFSXCezPm61nRjiKhLtY6O1soIgLzSv_NyjdwQIbmJByiBv1NsH7I (ca22a1cb)
2018-06-11T16:11:30.0259399-04:00 0HLEFQTLST4A2:00000007 [INF] AuthenticationScheme: "idsrv" was successfully authenticated. (1805f3b3)
2018-06-11T16:11:30.0280733-04:00 0HLEFQTLST4A2:00000007 [INF] AuthenticationScheme: "idsrv" was successfully authenticated. (1805f3b3)
2018-06-11T16:11:30.0356306-04:00 0HLEFQTLST4A2:00000007 [INF] Executing action method "IBI.Login.Service.Controllers.AccountController.Logout (IBI.Login.Service)" with arguments (["CfDJ8Lr1ecTh1x5IjvA0NxR18eixqgY1PROntfeC5wQJbnQmhM8qTPkm3Dt4ckYZ5sm1NFGrcOh2t67DG6X5buzj8klwDUz8rXzYBIFoTpxIKk4Zi-BhQIimvGKeukPMtgodz16q47X8PTqvaq0TIPLNPvl-QEh54ZZBafc9lk0amvlttW4CPfGGwoCpUJV_vwt9n6B7uu4_WEKaX65qF8O0vu7f-i-IZ_up2T19USJoZMSmy5uRo7-ZpReWgMfB6Ym2jOrWYA2KQBlKgczfmAWyj7eGbz0jRXecCbgcqwIVfVHsgWGL4-DdvM44YG7mp7-AvJAQ1ZOeLT2ootHcwt_ulYNb_zsy-OCT-XdblPBGAXuLqzuTuvEpbkUnF0cE2Amltwmq_ZWc89GK9QG_Ectubzl23k3S0oJ0AjHFSXCezPm61nRjiKhLtY6O1soIgLzSv_NyjdwQIbmJByiBv1NsH7I"]) - ModelState is Valid (ba7f4ac2)
Я использую MVCHybrid из примера решения с этой настройкой в клиенте.
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = "oidc";
})
.AddCookie(options =>
{
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
options.Cookie.Name = "mvchybrid";
})
.AddOpenIdConnect("oidc", options =>
{
// options.SignInScheme = "mvchybrid";
options.Authority = "https://localhost:44329/";
options.RequireHttpsMetadata = false;
options.ClientSecret = "superSecretPassword";
options.ClientId = "webFrameworkOpenIdClient";
options.Resource = "openid profile api1 offline_access";
options.ResponseType = "code id_token token";
options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
// options.Scope.Add("email");
options.Scope.Add("api1");
options.Scope.Add("offline_access");
options.GetClaimsFromUserInfoEndpoint = true;
options.SignedOutRedirectUri = "http://localhost:21402/";
// options.SaveTokens = true;
options.TokenValidationParameters = new TokenValidationParameters
{
NameClaimType = JwtClaimTypes.Name,
RoleClaimType = JwtClaimTypes.Role,
};
});
Результат действия выхода из системы MvcHybrid выглядит следующим образом
public IActionResult Logout()
{
return new SignOutResult(new[] { "Cookies", "oidc" });
}
URL-адрес находится в базе данных и настроен как http://localhost:21402/ и http://localhost:21402/signout-callback-oidc, чтобы быть уверенным, что оба доступны.
Может кто-нибудь подсказать, какчтобы получить эту настройку правильно?Из всего, что я вижу, данные настроены правильно и данные передаются по проводам правильно.
Мысли?