AzureADB2C.UI doesn't allow customizing post-logout redirect URI
See original GitHub issueI’m using Microsoft.AspNetCore.Authentication.AzureADB2C.UI to provide B2C login in a (server-side) Blazor app. The problem is that after the user logs out (by navigating to AzureADB2C/Account/SignOut
), they are logged out and redirected back to a generic ‘signed out’ page at /AzureADB2C/Account/SignedOut.
I would like to be able to customize where the user is redirected back to after logout, but my app is just a simple SPA and I’d rather not add controllers or extra pages just for that functionality. If it were possible to configure the callback URL used by the AzureADB2C.UI library, that would solve the issue.
I’ve worked around the issue by re-writing calls to /AzureADB2C/Account/SignedOut using app.UseRewriter
as suggested on StackOverflow. It seems like making AzureADB2C.UI’s callback URL configurable would be an even cleaner solution, though.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
@MauriRojas Made some changes to this, seems to work:
Redirects to root by default, set SignedOutRedirectUri if you’re using a custom logout component.
You can use
IApplicationBuilder.UseRewriter
to redirect requests to/AzureADB2C/Account/SignedOut
to a different URL. Here’s the code I added towards the beginning of myStartup.Configure
method to use the rewriter: