IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

IdentityServerConstants.ProfileDataCallers to have EndSessionRequest

Open jmatheti opened this issue 7 years ago • 5 comments

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 EndSessionRequest so the profile service IsActiveContext.Caller will 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.

jmatheti avatar Jul 24 '19 02:07 jmatheti

I'll have a look. The validator might be able to be more lax in some scenarios.

brockallen avatar Dec 10 '19 16:12 brockallen

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.

stale[bot] avatar Jan 10 '20 09:01 stale[bot]

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.

brockallen avatar Mar 25 '20 19:03 brockallen

PR merged.

brockallen avatar Mar 31 '20 15:03 brockallen

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.

lock[bot] avatar May 05 '20 22:05 lock[bot]