Open Closed

Change login cshtml to Blazor #8827


User avatar
0
maria_ruiz created
  • ABP Framework version: v9.0.4
  • UI Type: Blazor Webapp Interactive Auto
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

Hi, we need to change the login offered by abp to a blazor login.

We already had customised the default login, with the Default.cshtml file, but we need the login to be a razor.

We have migrated to webapp interactive auto and the wasm are not downloaded until you login, the idea is that as soon as you login the files are downloaded but it has to be a blazor page not a cshtml.

What would be the correct way to replace it?


4 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @maria_ruiz

    In the current Volo.Account and Volo.Account.Pro modules does not implement blazor login pages. It uses Code Flow with OpenID Connect.

    Only Angular application has an implementation for Resource Owner Password Flow but it's not enabled by default, developers should implement a related pacakage that brings those login/register account pages. Since it's not secure and not a recommended way, all of applications are pre-configured to use OpenID Connect Code Flow approach. If you need, you can implement blazor components for login and use an existing OpenId Client C# library such as IdentityModel.OidcClient to connect to the auth server.

    As far as I understand, login operation is not your problem right know, you want to initialize blazor wasm as far as soon, right?

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    As far as I understand, login operation is not your problem right know, you want to initialize blazor wasm as far as soon, right?

    I can suggest you try PWA configuration for your app, pre-configured service-worker caches all the .dll files and makes blazor wasm initialization at second visit to website so much faster. You may try this approach and even it won't satisfy, then you can try implement your own login page as my suggestion for now

  • User Avatar
    0
    maria_ruiz created

    Hi, thank you

    Let's try PWA,

    anyway the login, if we develop our own login, how do we make it so that the default abp login does not appear?

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    how do we make it so that the default abp login does not appear?

    You can't remove Microsoft.AspNetCore.Components.WebAssembly.Authentication package from your application because ABP modules are depending on it:

    But you can remove configuration from Module class, you can find a method named ConfigureAuthentication. You can remove configuration from there and configure & register your own Oidc Client into service collection. Then you'll use your OidcClient in your own razor component/page

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 25, 2025, 11:10