I can't get the PostLogoutRedirectUri from IdentityServer4 because logoutId on my Logout action is always null. I checked and the PostLogoutRedirectUris property has the same exact url I'm sending and it still won't work, logoutId is always null.
After researching a little bit deeper I found out one of the errors being thrown are due to IsActiveContext
not being active:
I just couldn't find the process to fix it and confirm if this is the only problem.
Logs:
Code:
ClientStore
:
var client = new Client
{
ClientId = application.Key,
ClientName = application.Description,
AllowedGrantTypes = grantType,
AllowedScopes = new List<string>
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile,
IdentityServerConstants.StandardScopes.Email,
IdentityServerConstants.StandardScopes.OfflineAccess,
"role",
"openIdConnectClient"
},
AllowOfflineAccess = true,
AllowAccessTokensViaBrowser = true,
RedirectUris = new List<string> { application.Url },
PostLogoutRedirectUris = new List<string> { $"{application.Url}" },
RequireConsent = false,
ClientSecrets = new List<Secret> { new Secret(application.Key.Sha256()) }
};
Request:
I've read a lot of related questions such as, but not limited to: