#30MinsLearning Day 12, in the code implementation, this Context.SignInAsync() method got me confused for quite a while. Firstly, there's no SignInAsync() method on HttpContext class: learn.microsoft.com/en-us/dotnet... ...
Bluesky

Bluesky Social
#30MinsLearning Day 11, today, I read the code and created a top level sequential for `/login` of #aspnetcore #identity. The code is pretty straightforward. It supports 2 types of scheme - cookie or token. It starts with user name, password sign in, and check to see if 2FA is needed. For 2FA... ๐Ÿงต
Bluesky

Bluesky Social
#30MinsLearning Day 10, move on to read '/login' in #aspnetcore #identity, keys about handling the SignInResult. And here's a break down of it. The class is pretty straight forward ๐Ÿงต๐Ÿ‘‡ #dotnet #csharp There are 4 boolean properties: Succeeded, IsLockedOut, IsNotAllowed, RequestTwoFactor. And 5 ...
Bluesky

Bluesky Social
#30MinsLearning Day 9, Ok, this 1 took 30+ mins. Well, to understand the code for `/register` of #aspnetcore #identity, I created a sequential chart to visualize it: It takes 7 parties to finish the registration. It is #SOLID, but is it #overengineered? What about KISS? Worth it? ๐Ÿค” #dotnet #csharp
Bluesky

Bluesky Social
#30MinsLearning Day 8: Today, I read the code of UserManager.CreateAsync(), it relies on the PasswordStore to set the password hash, then calls the UserStore to create the user in real - like in db. The responsibilities are quite clear. >>>๐Ÿงต #dotnet #csharp #aspnetcore #identity #auth #authZ
Bluesky

Bluesky Social
#30MinsLearning Day 7: Today, I sit down and read the `/register` endpoint code. Most of them is easy, validate the email, and create the user. This part, though, I don't understand why: ๐Ÿงต #dotnet #csharp #aspnetcore #identity #auth #authZ
Bluesky

Bluesky Social
#30MinsLearning Day 6: Try to understand the relations of asp.net core identity tables. Some are simple, a user could have multiple roles, a role has multiple users, forming a m:n by 3 tables. ๐Ÿงต #dotnet #csharp #auth #identity #sql #relational #aspnetcore
Bluesky

Bluesky Social
#30MinsLearning Day 5: I got the identityDB context into a #sql server. It is a journey. To reach here, I ran a sql express in #container on #Ubuntu, get basics of #EntityFramework migrations, figured out the nugets to reference, and derived IdentityDbContext. ๐Ÿ’ช #dotnet
Bluesky

Bluesky Social
#30MinsLearning Day 4: migrated the first database using entity framework core 9.0 into the SQL database. It turned out the most difficult part was actually write the correct connection string.
Bluesky

Bluesky Social
#30MinsLearning Day 3: Tried to connect to the sql server locally. I used the SSMS years ago. On Linux, I'll need some crossplat, #vscode mssql ext looks good. Turned out, most of the 30 mins today figuring the port 1434 (not the default 1433) I mapped by mistake ๐Ÿซ  #dotnet #mssql #container.
Bluesky

Bluesky Social