Search code examples
.netsql-serverasp.net-identityblazorblazor-webassembly

Blazor client authentication login against the User table in a SQL Server database (I know this bad practise, but it is just a test)


In my appsettings.json I have set up the server login, works just fine.

I would like to change the login form, from email / password to user / password and authenticate from the users in a SQL Server database, but I can't find anything in my pages folder that looks remotely like the login form? Can anybody point me in the right direction?

  • Question #1: where is the login form to be found?
  • Question #2: get the login form to authenticate with the users in the SQL Server database?

Solution

  • Question #1: where is the login form to be found?

    When you scaffold the Indentity UI you can select from a range of pages.
    Server Project: Add | New Scaffolded Item | Identity

    Question #2: get the login form to authenticate with the users in the SQL Server database?

    The login page already uses 'UserName' to login. The switch should be made on the Register page where UserName is set to the EmailAddress by default.

    The scaffolded items contain the C# code, edit away.