This template supports passwordless authentication using the Freighter wallet extension. Users can register and log in using their Stellar accounts managed by Freighter.
-
Install Freighter Wallet Extension
-
Configure Freighter in the Application
- No additional server-side configuration is needed.
- Ensure the client-side scripts include calls to the Freighter API.
- Users can register by connecting their Freighter wallet.
- The application stores the user's Stellar public key for authentication.
- Users authenticate by signing a challenge message using Freighter.
- The server verifies the signature to authenticate the user.
Enhance security by enabling MFA using authenticator apps.
-
Configure Identity Options
In
Startup.cs
orProgram.cs
:services.AddIdentity<ApplicationUser, IdentityRole>(options => { options.SignIn.RequireConfirmedAccount = true; options.Tokens.AuthenticatorTokenProvider = TokenOptions.DefaultAuthenticatorProvider; }) .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenProviders();
-
Add MFA Views and Logic
- Enable MFA Page: Guides users to set up MFA.
- Login with MFA: Prompts users for the verification code during login.
-
Update User Interface
- Include options for users to manage their MFA settings.