Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect On Signout without making your own Controller #55329

Closed
1 task done
AlexHolmes4 opened this issue Apr 24, 2024 · 1 comment
Closed
1 task done

Redirect On Signout without making your own Controller #55329

AlexHolmes4 opened this issue Apr 24, 2024 · 1 comment
Labels
area-identity Includes: Identity and providers

Comments

@AlexHolmes4
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I would like to sign out via the standard method but either; provide a redirect on signout value on config, or hook onto the config event OnRemoteSignOut to go to the home page.

Many Apps allow users to see basic app info without being logged in, and it's not the best experience to be left on a page with no clear way to get back to the homepage.

I am working in Blazor Server where I do not have an API layer, other than the Microsoft.Identity.Web package added controllers to handle signin and signout. So I'd rather avoid creating more complexity in my codebase.

#21580 ---- This issue described the problem but was closed as a workaround was to create your own controller to override the default.

Thanks for the help 👍

Describe the solution you'd like

Is there capacity to allow for a redirect uri to be provided that will be hit after signout from tenant?

Additional context

I have not worked a heap with auth at this time so apologies for any oversight.
If I am not mistaken the MSAL OIDC (not the Identity.Web) package provides a method to redirect ? So this can be a last resort if I have to pull out this library.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Apr 24, 2024
@gfoidl gfoidl added area-identity Includes: Identity and providers and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Apr 24, 2024
@SteveSandersonMS
Copy link
Member

Because Blazor Server works within a websocket connection, it doesn't have access to an HttpContext and so signing out by calling HttpContext's SignOut method isn't available directly. That's why there needs to be a controller to act as an endpoint that will be able to act on an HttpContext. Perhaps you already know, and if so sorry to repeat the info!

We don't have evidence that adding this extra controller (or other middleware/endpoint) is a significant problem for many people in the community, so we're unlikely to prioritize changing this any time soon. We can reconsider if a lot of other people run into difficulty with this. Hope it's OK with you to add the controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-identity Includes: Identity and providers
Projects
None yet
Development

No branches or pull requests

3 participants