Hi
I want to show the login page after the logout click currently when we click on logout so it calls authentication/loggedout page and logout page so can we direct show the login page after logout.
I want to restrict extra redirection. Please suggest me.
- ABP Framework version: v4.43
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
17 Answer(s)
-
0
Is there anybody who can help me out!
-
0
If you set your default application's home/index page with
[Authorize]
, you will automatically redirected back to login page. -
0
[Authorize]
Are you talking about index.razor page. We have this page in blazor project and [Authorize] tag is already there.
-
0
If you have it authorized, it should be redirecting back to login page already. Can you share a video, or gif of the process that show the problem you are having with?
-
0
If you have it authorized, it should be redirecting back to login page already. Can you share a video, or gif of the process that show the problem you are having with?
Can u send me your mail id?
-
0
-
0
-
0
- Do you have any errors when you check developer console (F12) of the browser?
- Is your project template Blazor WebAssemby non-tiered? What is your exact template version?
- Do you have front-channel logout altered or any identityserver-related data changes?
-
0
- Do you have any errors when you check developer console (F12) of the browser?
- Is your project template Blazor WebAssemby non-tiered? What is your exact template version?
- Do you have front-channel logout altered or any identityserver-related data changes?
No not able to see any error in console also I am using blazor webassembly non-tiered and the version is 4.4.3.
-
0
- Do you have any errors when you check developer console (F12) of the browser?
- Is your project template Blazor WebAssemby non-tiered? What is your exact template version?
- Do you have front-channel logout altered or any identityserver-related data changes?
Are you guys looking into it or Just joking with me?
-
0
- Do you have any errors when you check developer console (F12) of the browser?
- Is your project template Blazor WebAssemby non-tiered? What is your exact template version?
- Do you have front-channel logout altered or any identityserver-related data changes?
Are you guys looking into it or Just joking with me?
Hello,
It could be shorter if you would share the link (/authentication/logged-out) in the screenshot.
After IdentityServer single logout action, the user is redirected back to Blazor application. This URL (/authentication/logged-out) is handled by the Microsoft OIDC Provider and it is not related to ABP.
When we investigate more about the Microsoft.AspNetCore.Components.WebAssembly.Authentication, we have limited options to modify the remote views.
Instead of modifying the remote view, you can set the
authentication/logged-out
path to index page should redirect you back to login page since theindex.razor
is supposed to be authorized already.Update the ConfigureAuthentication method of
BlazorModule
as follows:private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) { builder.Services.AddOidcAuthentication(options => { builder.Configuration.Bind("AuthServer", options.ProviderOptions); options.UserOptions.RoleClaim = JwtClaimTypes.Role; options.AuthenticationPaths.LogOutSucceededPath = "/"; // This will redirect the application to "/" instead of logged-out page which will trigger authentication again options.ProviderOptions.DefaultScopes.Add("MyApp"); options.ProviderOptions.DefaultScopes.Add("role"); options.ProviderOptions.DefaultScopes.Add("email"); options.ProviderOptions.DefaultScopes.Add("phone"); }); }
<br> You can see Microsoft documentation of Blazor Web Assembly for additional scenarios for more information.
-
0
-
0
- Do you have any errors when you check developer console (F12) of the browser?
- Is your project template Blazor WebAssemby non-tiered? What is your exact template version?
- Do you have front-channel logout altered or any identityserver-related data changes?
Are you guys looking into it or Just joking with me?
Hello,
It could be shorter if you would share the link (/authentication/logged-out) in the screenshot.
After IdentityServer single logout action, the user is redirected back to Blazor application. This URL (/authentication/logged-out) is handled by the Microsoft OIDC Provider and it is not related to ABP.
When we investigate more about the Microsoft.AspNetCore.Components.WebAssembly.Authentication, we have limited options to modify the remote views.
Instead of modifying the remote view, you can set the
authentication/logged-out
path to index page should redirect you back to login page since theindex.razor
is supposed to be authorized already.Update the ConfigureAuthentication method of
BlazorModule
as follows:private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) { builder.Services.AddOidcAuthentication(options => { builder.Configuration.Bind("AuthServer", options.ProviderOptions); options.UserOptions.RoleClaim = JwtClaimTypes.Role; options.AuthenticationPaths.LogOutSucceededPath = "/"; // This will redirect the application to "/" instead of logged-out page which will trigger authentication again options.ProviderOptions.DefaultScopes.Add("MyApp"); options.ProviderOptions.DefaultScopes.Add("role"); options.ProviderOptions.DefaultScopes.Add("email"); options.ProviderOptions.DefaultScopes.Add("phone"); }); }
<br> You can see Microsoft documentation of Blazor Web Assembly for additional scenarios for more information.
Please check this
-
0
- Do you have any errors when you check developer console (F12) of the browser?
- Is your project template Blazor WebAssemby non-tiered? What is your exact template version?
- Do you have front-channel logout altered or any identityserver-related data changes?
Are you guys looking into it or Just joking with me?
Hello,
It could be shorter if you would share the link (/authentication/logged-out) in the screenshot.
After IdentityServer single logout action, the user is redirected back to Blazor application. This URL (/authentication/logged-out) is handled by the Microsoft OIDC Provider and it is not related to ABP.
When we investigate more about the Microsoft.AspNetCore.Components.WebAssembly.Authentication, we have limited options to modify the remote views.
Instead of modifying the remote view, you can set the
authentication/logged-out
path to index page should redirect you back to login page since theindex.razor
is supposed to be authorized already.Update the ConfigureAuthentication method of
BlazorModule
as follows:private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) { builder.Services.AddOidcAuthentication(options => { builder.Configuration.Bind("AuthServer", options.ProviderOptions); options.UserOptions.RoleClaim = JwtClaimTypes.Role; options.AuthenticationPaths.LogOutSucceededPath = "/"; // This will redirect the application to "/" instead of logged-out page which will trigger authentication again options.ProviderOptions.DefaultScopes.Add("MyApp"); options.ProviderOptions.DefaultScopes.Add("role"); options.ProviderOptions.DefaultScopes.Add("email"); options.ProviderOptions.DefaultScopes.Add("phone"); }); }
<br>
You can see Microsoft documentation of Blazor Web Assembly for additional scenarios for more information.Please check this
After logout it's going to login page but if we try to login again it's going to swagger link
-
0
Sorry, I am not available for remote sessions. But these are the steps I have followed:
I had removed ABP CLI to install ABP CLI version 4.4.3 in order to create a Blazor application for version 4.4.3.
Updated the Index.razor.cs file:
namespace MyApp.Blazor.Pages { [Authorize] public partial class Index { } }
This configuration automatically redirects the application to login page. Update MyAppBlazorModule.cs file:
private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) { builder.Services.AddOidcAuthentication(options => { builder.Configuration.Bind("AuthServer", options.ProviderOptions); options.UserOptions.RoleClaim = JwtClaimTypes.Role; options.AuthenticationPaths.LogOutSucceededPath = "/"; options.ProviderOptions.DefaultScopes.Add("MyApp"); options.ProviderOptions.DefaultScopes.Add("role"); options.ProviderOptions.DefaultScopes.Add("email"); options.ProviderOptions.DefaultScopes.Add("phone"); }); }
Result:
-
0
Sorry, I am not available for remote sessions. But these are the steps I have followed:
I had removed ABP CLI to install ABP CLI version 4.4.3 in order to create a Blazor application for version 4.4.3.
Updated the Index.razor.cs file:
namespace MyApp.Blazor.Pages { [Authorize] public partial class Index { } }
This configuration automatically redirects the application to login page. Update MyAppBlazorModule.cs file:
private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) { builder.Services.AddOidcAuthentication(options => { builder.Configuration.Bind("AuthServer", options.ProviderOptions); options.UserOptions.RoleClaim = JwtClaimTypes.Role; options.AuthenticationPaths.LogOutSucceededPath = "/"; options.ProviderOptions.DefaultScopes.Add("MyApp"); options.ProviderOptions.DefaultScopes.Add("role"); options.ProviderOptions.DefaultScopes.Add("email"); options.ProviderOptions.DefaultScopes.Add("phone"); }); }
Result:
Yes, it's working like this. Is there any way to remove account/loggedout page redirection?
-
0
Unfortunately, there is no mention of it in this documentation: https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/additional-scenarios?view=aspnetcore-6.0
We (as ABP Framework) don't implement directly this flow. It's implemented by Microsoft, you may ask them about it. There may be an internal API or something else but I don't think so. Because that component performs the functionality, if you can achieve to remove it, the logout functionality won't be performed at the end.