@@ -12,7 +12,7 @@ In this guide, you will set up UltimateAuth in a few minutes and perform your **
1212
1313## 1. Create a Project
1414
15- Create a new Blazor Server web app:
15+ Start by creating a new Blazor app:
1616
1717``` bash
1818dotnet new blazorserver -n UltimateAuthDemo
@@ -21,7 +21,7 @@ cd UltimateAuthDemo
2121
2222## 2. Install Packages
2323
24- Add UltimateAuth packages:
24+ Install the required UltimateAuth packages:
2525
2626``` csharp
2727dotnet add package CodeBeam .UltimateAuth .Server
@@ -69,7 +69,46 @@ Replace `Routes.razor` with this code:
6969< UAuthApp UseBuiltInRouter = " true" AppAssembly = " typeof(Program).Assembly" DefaultLayout = " typeof(Layout.MainLayout)" / >
7070```
7171
72- ## 8. Perform Your First Login
72+ ## 8. Recommended Setup (Optional)
73+ Add these for better experience :
74+
75+ For login page (Use this only once in your application )
76+ ```csharp
77+ @attribute [UAuthLoginPage ]
78+ ```
79+
80+ For protected pages
81+ ```csharp
82+ @attribute [UAuthAuthorize ]
83+ ```
84+
85+ For any page that you use UltimateAuth features like AuthState etc .
86+ ```csharp
87+ @inherits UAuthFlowPageBase
88+ ```
89+
90+ ## 9. Seed Data For QuickStart (Optional)
91+ This code creates admin and user users with same password and admin role .
92+
93+ For in memory
94+ ```csharp
95+ builder .Services .AddUltimateAuthSampleSeed ();
96+ ```
97+
98+ For entity framework core:
99+ ``` csharp
100+ builder .Services .AddScopedUltimateAuthSampleSeed ();
101+ ```
102+
103+ In pipeline configuration
104+ ``` csharp
105+ if (app .Environment .IsDevelopment ())
106+ {
107+ await app .SeedUltimateAuthAsync ();
108+ }
109+ ```
110+
111+ ## 10. Perform Your First Login
73112Example using IUAuthClient:
74113``` csharp
75114[Inject ] IUAuthClient UAuthClient { get ; set ; } = null ! ;
@@ -78,8 +117,8 @@ private async Task Login()
78117{
79118 await UAuthClient .Flows .LoginAsync (new LoginRequest
80119 {
81- Identifier = " demo " ,
82- Secret = " password "
120+ Identifier = " admin " ,
121+ Secret = " admin "
83122 });
84123}
85124```
0 commit comments