How to add Authentication in Server-side Blazor | Blazor Tutorial 8

  Рет қаралды 58,568

Nick Chapsas

Nick Chapsas

Күн бұрын

Пікірлер: 64
@j_ason_rpg
@j_ason_rpg 3 жыл бұрын
Gold to the first person to post a video showing how to properly generate authentication and authorization components using Blazor WITHOUT littering the project with Entity Framework, as so far, after looking far and wide, I have found no one.
@Serjaru
@Serjaru 2 жыл бұрын
Good practice and respect for subscribers when posting sources code. This is for the future!
@thibaudgalland1524
@thibaudgalland1524 3 жыл бұрын
Great video ! How would you handle the authentication process with an external WebApi and JWT token ?
@RandomPerson-nh7yk
@RandomPerson-nh7yk Жыл бұрын
Fantastic tutorial! Very helpful and works like a charm. One request though for a follow up video, I guess: could you possibly walk through how to add user roles to this process. I want to have various roles like Admin, Contributor, Readonly, etc. I know there are tables in the created database like Roles and UserRoles where such association is created, but how do I have those populated when users are created and then how do I retrieve this information to restrict access to various components accordingly? This would be very very helpful indeed!
@onnuttig
@onnuttig 4 жыл бұрын
Thanks for the clear explanations, it was very easy to follow
@iancarr3923
@iancarr3923 5 жыл бұрын
Great thanks - fits it well with a current project.
@whynotsquat8315
@whynotsquat8315 2 жыл бұрын
I could not find your CLIENT-SIDE video. Also, no videos on WebAssembly Blazor at all? :(
@morph4358
@morph4358 4 жыл бұрын
What if we are using an external API to login using JWT and an external REST API to send and receive data, and we are using the Blazor app as if it was a Client which isn't directly connected to a database of its own? How would we then do this authentication/authorization?
@MrBa143
@MrBa143 3 жыл бұрын
I know your comment is old, but for everyone else looking for a "custom" solution with or without your own database. You can create your own custom authentication state provider, and that will provide methods, in which you return AuthStates containing claims. You can then generate these claims yourself, based on your own data (A token you have received from your AuthProvider containing your claims / data etc)
@KenzoArts
@KenzoArts 4 жыл бұрын
Hello my friend, do you have a tutorial on CustomAuthentificationStateProvider ?
@trongphan6197
@trongphan6197 4 жыл бұрын
Thanks for the series. Can you do the login that using razor component for Blazor server?
@shahab2025
@shahab2025 2 жыл бұрын
Thanks for Video, What is the name of IDE ?
@DeathStarKitty
@DeathStarKitty 4 жыл бұрын
at 12:55 when you add the logout link to _LoginPartial it should be a submit button inside a form so that LogOut.cshtml can handle the post. Otherwise it doesn't do anything but display a blank page.
@naasthikan
@naasthikan 3 жыл бұрын
Can you please help me to do it i'm a beginner
@naasthikan
@naasthikan 3 жыл бұрын
@@DMS20231 can you show an example please >?
@naasthikan
@naasthikan 3 жыл бұрын
@@DMS20231 thanks for replying bro but it doesn't work
@ej2649
@ej2649 Жыл бұрын
Yes. instead of using "LogOut", use " Logout"
@graynoble4795
@graynoble4795 4 жыл бұрын
Great video! Thank you!
@joaquinlion
@joaquinlion 5 жыл бұрын
Excuse me, are you using here the Authentication option when creating the project template from zero? how can i use this authentication option adding a postgreSql database for users data?
@talkathiriify
@talkathiriify 5 жыл бұрын
Great job Thank you very much.
@bashirmanafikhi
@bashirmanafikhi 4 жыл бұрын
How can we set Identity layout to our blazor layout?
@jozefkomara7065
@jozefkomara7065 4 жыл бұрын
great tutorial
@rainron2664
@rainron2664 3 жыл бұрын
Sir how about blazor server dealing with identity server?. 😊
@3wsystems663
@3wsystems663 4 жыл бұрын
not found...the .AddDefaultIdentity .. services.AddDefaultIdentity().AddEntityFrameworkStores();
@MerrStudio
@MerrStudio 4 жыл бұрын
How do I change the login form? I just want a login and a password and that's all. Also a simpler database table for logins.
@Balgoriusis
@Balgoriusis 4 жыл бұрын
You must implement your own user class and usestore and give that to the identity Builder. That also means making all of the database calls for the userstore.
@80-two
@80-two 4 жыл бұрын
Busta Rhymes?! Is that you?!
@petemartinez3017
@petemartinez3017 3 жыл бұрын
I am a little confused because it seems like Identity Server 4 isn't free for Production.
@nickchapsas
@nickchapsas 3 жыл бұрын
This is ASP.NET Core Identity not Identity Server 4
@petemartinez3017
@petemartinez3017 3 жыл бұрын
@@nickchapsas wasnt aware of that! Thanks for letting me know.
@iraqjongen
@iraqjongen 5 жыл бұрын
Where can I change the login view?
@christianrazvan
@christianrazvan 4 жыл бұрын
Now make the same video without using entity framework
@mohammadmz1058
@mohammadmz1058 10 ай бұрын
Great video, but where is the source code
@iteospace
@iteospace Жыл бұрын
Try add scaffild identity pages for customizing and it broke your project
@fahadmullaji
@fahadmullaji 4 жыл бұрын
If you use visual studio and select authentication support, when you create the project then all you showed comes out of the box
@nickchapsas
@nickchapsas 4 жыл бұрын
I am well aware of it. Rider has the exact same functionality. The point was to explain exactly what’s going on instead of blindly following it.
@manoa98
@manoa98 4 жыл бұрын
Wheres the Register and Login code page?
@nickchapsas
@nickchapsas 4 жыл бұрын
It’s within the aspens.identity package
@filippomingo6784
@filippomingo6784 3 жыл бұрын
​@@nickchapsas yes but u dont show scaffolding, so my question is ho can i go to the Login's Url if is dosent exist the login page? The problem is that uo pass form the previous video to this one without showing some passages. I also pay the monthly bill but....
@kourosh234
@kourosh234 4 жыл бұрын
wasn't it easier to scaffold the identity area?
@nickchapsas
@nickchapsas 4 жыл бұрын
It was you totally right but I would have to also explain what scaffolding is. I wanna keep my videos as self contained and as to the point as possible.
@e.h.5680
@e.h.5680 4 жыл бұрын
@@nickchapsas You hammered away at the keyboard for half an hour straight, to add something as straightforward as enabling authentication in a website. Either you are using the wrong way to do this or Blazor and its identity and authentication model is very broken.
@wassollderscheiss33
@wassollderscheiss33 4 жыл бұрын
After watching until minute 1 I realized your example would employ those weirdo MS database tables for storing userdata. No sane person is interested in that. I would never litter my database with that.
@sinan720
@sinan720 4 жыл бұрын
Do you realize that you can customize it? If you're not smart enough to be able do that than thats your problem. Dont call people insane just because you dont know how asp net core identity works.
@mohammadmz1058
@mohammadmz1058 10 ай бұрын
Just use mssql instead, like this: add nuget package: Microsoft.EntityFrameworkCore.SqlServer in program.cs add builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); and in in appsettings.json add "ConnectionStrings": { "DefaultConnection": "Server=localhost; Database=mydatabasename; Trusted_Connection=true; MultipleActiveResultSets=true; TrustServerCertificate=true;" },
@jd-code
@jd-code 3 жыл бұрын
I would like to clear another question regarding a . Can you get in touch via email?
@mehrtashsouri6862
@mehrtashsouri6862 4 жыл бұрын
You are speaking Toooooo fast mate. but nice tutorial
@pilotboba
@pilotboba 4 жыл бұрын
You can adjust playback speed from the gear menu.
@mehrtashsouri6862
@mehrtashsouri6862 4 жыл бұрын
@@pilotboba Thanks Bob
@mehrtashsouri6862
@mehrtashsouri6862 4 жыл бұрын
@@pilotboba kzbin.info/www/bejne/aomXd6xujtasqbs
@resistnoevil622
@resistnoevil622 4 жыл бұрын
Just another incomplete video. Where is the data(username password) in database against which the user will be validated. You did not show us that information.
@nickchapsas
@nickchapsas 4 жыл бұрын
Well that wasn't really polite but I'm going to reply anyway. Since we are using ASP.NET Core Identity, this is all managed automatically by .NET Core, and EF Core for us so we don't need to deal with it ourselves. This is why nobody is talking about it. Because nobody needs to. The framework is doing that for us.
@resistnoevil622
@resistnoevil622 4 жыл бұрын
@@nickchapsas thanks for the reply. However, isn't there a way to add more fields(such as Country, City, Zipcode...) in the user-registration form generated by Blazor?
@nickchapsas
@nickchapsas 4 жыл бұрын
@@resistnoevil622 Yeah there is. You need to extend the IdentityUser class and add your own custom properties, then update the DbContext to be an IdentityDbContext and make sure that you create and run EF migrations and that's it.
@resistnoevil622
@resistnoevil622 4 жыл бұрын
@@nickchapsas we can do this via ApplicationUser class, not IdentityDbContext. But can we customize the internal authentication logic, change field types etc? If yes, how?
Authorization in Server-Side Blazor | Blazor Tutorial 9
16:04
Nick Chapsas
Рет қаралды 21 М.
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
ПРЯМОЙ ЭФИР. Золотой мяч France Football 2024
4:41:06
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 101 МЛН
How to implement authentication in Blazor Server from scratch
57:22
State Management in Blazor Apps
41:31
dotnet
Рет қаралды 24 М.
Blazor Tutorial : Authentication | Custom AuthenticationStateProvider - EP12
29:46
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 63 М.
What are Razor Components? | Blazor Tutorial 1
12:48
Nick Chapsas
Рет қаралды 34 М.
How to Measure Time Correctly in .NET
9:43
Nick Chapsas
Рет қаралды 38 М.
Implementing JWT Authentication in ASP.NET Core
23:51
Nick Chapsas
Рет қаралды 34 М.
Blazor in more depth - Ryan Nowak & Steve Sanderson
1:02:12
NDC Conferences
Рет қаралды 36 М.
Top 5 Free Blazor Resources (plus a couple of extras)
17:32
IAmTimCorey
Рет қаралды 74 М.
КОГДА К БАТЕ ПРИШЕЛ ДРУГ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН