docs/en/framework/ui/blazor/authentication.md
//[doc-seo]
{
"Description": "Learn how to implement authentication in Blazor applications using OpenId Connect, with features like registration and password recovery."
}
//[doc-params]
{
"UI": ["Blazor", "BlazorServer"]
}
The application startup template is properly configured to use OpenId Connect to authenticate the user;
{{if UI == "BlazorServer"}}
The Blazor Server application UI is actually a hybrid application that is combined with the MVC UI, and uses the login page provided by the MVC UI. When users enter a page that requires login, they are redirected to the /Account/Login page. Once they complete the login process, they are returned back to the application's UI. The login page also contains features like registration, password recovery, etc.
{{end}}
{{if UI == "Blazor"}}
This is a typical and recommended approach to implement authentication in Single-Page Applications. The client side configuration is done in the startup template, so you can change it.
See the Blazor Security document to understand and customize the authentication process.
{{end}}
AbpAuthenticationOptions centralizes the login and logout routes used by ABP Blazor authentication services. The shared web defaults are Account/Login and Account/Logout. A standalone Blazor WebAssembly application changes them to authentication/login and authentication/logout; this override is not applied when the client is hosted as part of a Blazor Web App.
Configure the options when the application uses custom routes:
Configure<AbpAuthenticationOptions>(options =>
{
options.LoginUrl = "authentication/sign-in";
options.LogoutUrl = "authentication/sign-out";
});