Extend IIdentityProvider with Logout and CreateForbiddenResponse#16
Merged
ReneSchwarzer merged 1 commit intodevelopfrom Apr 14, 2026
Merged
Conversation
…ate HttpServer forbidden page flow Agent-Logs-Url: https://github.com/webexpress-framework/WebExpress.WebCore/sessions/42eb3cb9-7106-40a7-a098-76c8b8ae1498 Co-authored-by: ReneSchwarzer <31061438+ReneSchwarzer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ReneSchwarzer
April 14, 2026 19:09
View session
ReneSchwarzer
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Authenticated users who lack required permissions currently fall through to the login prompt or get no meaningful response. The identity system needs a dedicated forbidden-page mechanism and provider-level logout support.
Interface changes
IIdentityProvider.Logout(IRequest)— lets providers clear their own auth state (cookies, tokens, etc.) during logoutIIdentityProvider.CreateForbiddenResponse(IRequest, IEndpointContext, IIdentity)— returns a provider-specific forbidden page for authenticated-but-unauthorized usersIIdentityManager.CreateForbiddenResponse— same signature, delegates to registered providersIdentityManager
CreateForbiddenResponsefollows the existing first-provider-wins delegation pattern used byCreateAuthenticationPromptLogoutnow notifies all registered providers before clearing the session propertyHttpServer authorization flow
The request pipeline now distinguishes between unauthenticated and unauthorized:
Test
MockIdentityProviderupdated with no-op implementations of both new methods