IdentityServerConstants.ProfileDataCallers to have EndSessionRequest
Is your feature request related to a problem? Please describe.
This problem is a bit related to the old post https://github.com/IdentityServer/IdentityServer3/issues/1231
When the users are requesting logout after something of the user critical information is changed( Ex. admin changed the username, so security stamp changed), is having issues to gracefully logout.
EndSessionRequestValidator is calling the TokenValidator.ValidateIdentityTokenAsync which is calling _profile.IsActiveAsync. Since the user's security stamp is changed, the IsActive Async si returning "False". Regardless of the user active or inactive on logout requests, the flow should continue (without calling the profile.IsActive).
As an alternative, we are showing the default IDM logout page if the PostLogoutRedirectUri is empty (which means IDM did not resolved the client from the request though id_token and the valid postlogoutredirecturl exist.
I suggest the following changes
- Pass the context data caller as
EndSessionRequestso the profile serviceIsActiveContext.Callerwill give a provision to do a check and return "true".
//profileService IsActiveAsync
if (context.Caller == IdentityServerConstants.ProfileDataCallers.EndSessionEndPoint)
context.IsActive = true;
after all it make sense to clear the session and cookies of the user though they are not active or username or email address was changed.
Update after raising this request -
I can see the HttpContext.Request.Path - /end/session, so for now we are using this check to set the context.IsActive to true
So this request for now is optional, and treat this as a low priority.
I'll have a look. The validator might be able to be more lax in some scenarios.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
You can always change IsActive to use the caller to know if it's being checked from this scenario by comparing to the IdentityServerConstants.ProfileIsActiveCallers.IdentityTokenValidation constant value.
PR merged.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.