You're using AuthenticationStateProvider wrong in your Blazor Server app! Let's fix it!

  Рет қаралды 20,203

Codewrinkles

Codewrinkles

Күн бұрын

Пікірлер: 60
@skypinoify
@skypinoify 2 жыл бұрын
You are the first one who explained this concept very well. Most of the tutorials I've seen only explain, poorly, how to set up the authentication but they don't get into the detail of revalidation. Thanks.
@Codewrinkles
@Codewrinkles 2 жыл бұрын
I'm very glad to hear that. I also feel that the official docs is very vague and hard to understand. Another video on how to implement a custom AuthenticationStateProvider will come this week. I guess that these two videos together will shed some light on how everything works.
@victorcaceres3592
@victorcaceres3592 2 жыл бұрын
Hi In which series of your videos is the information on the management of the Menu on the right side, about Login Logout
@chrisjack3966
@chrisjack3966 2 жыл бұрын
Many thanks, worked perfectly... wasn't easy following the code would be great to have had the code listed somewhere but SUPER helpful so much appreciated ;)
@MiguelAngelHerrera
@MiguelAngelHerrera Жыл бұрын
Thank you very much! The best explanation of authentication in Blazor on the web.
@Codewrinkles
@Codewrinkles Жыл бұрын
Glad you enjoyed it.
@Chris-ri6ly
@Chris-ri6ly Жыл бұрын
Would it be possible/a good idea to call OnValidateAuthenticationStateAsync from OnInitializedAsync? So that way the user identity is checked automatically over time, but also checked before they try and access data while still in that 30s interval? Or would simply setting the interval time to 1-2 seconds be a better solution?
@ruinenlust_
@ruinenlust_ 11 ай бұрын
This is what I wondered too. I don't want my unauthenticated user to still be able to do everything they could before after logging out. I want to check every begin of the method. This periodic revalidation stuff is just not secure.
@aw__3476
@aw__3476 Жыл бұрын
Thank you so much for this! The MS docs were really hard to follow, but this works great
@Codewrinkles
@Codewrinkles Жыл бұрын
I'm lad to hear that. Thanks for watching.
@ajazahmad2386
@ajazahmad2386 Жыл бұрын
So much thanks to elaborating the Identity method. is very appreciated..
@ghevisartor6005
@ghevisartor6005 3 ай бұрын
does it also update the @page component itself for the [Authorize] attribute? so you get the NotAuthorized view on the whole page component?
@kartingmania6590
@kartingmania6590 Жыл бұрын
I really don't get why we need an extra (polling) mechanism for this. Surely, if we're making a Blazor SERVER application, we are talking to the server whenever we make any request. So surely this is the time to do any checking of session, rather than an extra mechanism that polls?
@kaz00ie
@kaz00ie Жыл бұрын
Thank you so much! This works in my hybrid project. Greetings from Argentina :)
@Codewrinkles
@Codewrinkles Жыл бұрын
Great to hear!
@RiGoRmOrTiSUK
@RiGoRmOrTiSUK Жыл бұрын
thank you for your videos, did you do any videos around adding roles and claims and creating pages to manage these?
@Codewrinkles
@Codewrinkles Жыл бұрын
Unfortunately it didn't come to that. Hopefully in the future.
@shabanelmogy7912
@shabanelmogy7912 5 ай бұрын
i need example if i use api and jwt with blazor server how can i implement RevalidatingServerAuthenticationStateProvider
@fh61234
@fh61234 2 жыл бұрын
Life saver. Thank you!!
@Codewrinkles
@Codewrinkles 2 жыл бұрын
Glad it helped!
@talkathiriify
@talkathiriify 2 жыл бұрын
Thank you so much for the excellent topic.
@Codewrinkles
@Codewrinkles 2 жыл бұрын
I'm glad you find it useful.
@loadiam
@loadiam Жыл бұрын
Is there a way to do the same thing that you do with IdentityValidationProvider.cs with Azure AD single tenant without using EF? So that it logs users out in other browser tabs?
@GauravKumar-ss2ic
@GauravKumar-ss2ic 2 жыл бұрын
Your this tutorial is very well explained and very useful. Is there any tutorial prepared by you without using Identity or may be by using JWT that is provided by a completly separate hosted core webapi
@leonardohidrovo4729
@leonardohidrovo4729 8 ай бұрын
What about using RevalidatingServerAuthenticationStateProvider when Identity Framework is not used?
@manojnaik5643
@manojnaik5643 4 ай бұрын
nice demonstration on this things, need an urgent help on creating user identity and maintain state using client server interactive auto mode, did not find any correct documentation on this, user session process made very complicated by ms. need help on this.
@goranmaric6806
@goranmaric6806 Жыл бұрын
Another great video. Thanks! Is there a way to elegantly and without usage of JavaScript implement automatic logout if user is not active for a certain period of time?
@Codewrinkles
@Codewrinkles Жыл бұрын
Not sure exactly how this might be useful or not and it would be definitely quite hacky as you would need to keep track of each user's interaction with the app within a single circuit.
@zohirbensalem7622
@zohirbensalem7622 5 ай бұрын
Very good explained ..Thanks So Much and Good Luck .hope you will bring to us code in github or any thing else. that will help me
@ajazahmad2386
@ajazahmad2386 Жыл бұрын
Please help me in soling the problem ie. when in registered the authenticatiostateproder , as //builder.Services.AddScoped(); during running the application it give the error like "unable to connect the web server https the webserver is no longer sunning "
@TheNollidge
@TheNollidge 2 жыл бұрын
Hi man! thanks for the upload this is good stuff I am working on a blazor wasm project at the moment and this video is the only one showing the issues I am trying to solve .. is there a similar solution for wasm projects? would be cool if there was a link to a example - microsoft documentation is so ambiguous to me most times and leads me in the wrong direction, unfortunately my peanut brain can't handle it. hope you see this comment! regards
@marna_li
@marna_li 2 жыл бұрын
I have noticed in one of my applications, where I get the UserId from a service that is wrapping the AuthenticationStateProvider, that after clicking around the service is returning a state with a User that is not authenticated, despite being logged in. This is in WebAssembly.
@Codewrinkles
@Codewrinkles 2 жыл бұрын
In Blazor WebAssembly the AuthenticationStateProvider is working totally differently, but I haven't investigated it in depth so far :(
@DavidThielen
@DavidThielen 3 ай бұрын
thank you - very helpful.
@patrickkuhnel9531
@patrickkuhnel9531 Жыл бұрын
It's a very good video, but this only works in Razor Components. How do I check in a separate class library from which user a request comes? E.g., I have a separate class library for all my services and want to get the user's GUID to save a `LastModifiedUser`.
@ghevisartor6005
@ghevisartor6005 6 ай бұрын
You should be able to have blazor services like NavigationManager available in other services if those services are injected in blazor components, so you can inject IAuthenticationStateProvider i think? Or use a middleware to set a scoped object.
@danielrdm
@danielrdm Жыл бұрын
Thanks for sharing this one.
@Codewrinkles
@Codewrinkles Жыл бұрын
I know the video is not the newest one, but it's stil actual. Thanks for dropping by.
@nithitsathornlak2721
@nithitsathornlak2721 2 жыл бұрын
Very useful, thank you so much.
@igorlaktic8891
@igorlaktic8891 2 жыл бұрын
Great stuff. Where we can download repo?
@muks8398
@muks8398 7 ай бұрын
Hey. Do you have a GitHub for this ?
@vanhutten1
@vanhutten1 2 жыл бұрын
Thanks, a lot of useful information
@MuhammadAshfaqSahil
@MuhammadAshfaqSahil 2 жыл бұрын
Excellent tutorial once again. Can you please share source code?
@VästerHöger
@VästerHöger 10 ай бұрын
Is authenticated and authorized being used synonymously here?
@VästerHöger
@VästerHöger 10 ай бұрын
Just because I know who you are does not mean you get access to everything.
@giampaolotucci5897
@giampaolotucci5897 2 жыл бұрын
Excellent ! Tnx
@kudasol
@kudasol Жыл бұрын
What will happen if the user is logged in from another browser?
@Codewrinkles
@Codewrinkles Жыл бұрын
I'm not sure exactly what scenario do we have in mind, but as long as you are using a RevalidatingAuthenticationStateProvider, the user will be logged out from all devices.
@lozdbzmario
@lozdbzmario Жыл бұрын
THANKS MAN U DA BES
@DJosh-cs5vx
@DJosh-cs5vx Жыл бұрын
Thanks Code Wrinkles
@Codewrinkles
@Codewrinkles Жыл бұрын
No problem!
@donaldmafa
@donaldmafa 8 ай бұрын
Where's the source code?
@ainy6406
@ainy6406 Жыл бұрын
those 40 minutes can easily be condensed into 4
@Codewrinkles
@Codewrinkles Жыл бұрын
Probably not 4, but it for sure could be condensed. This video is quite old. Nowadays my videos are much shorter and to the point.
@EniloracCodes
@EniloracCodes 5 ай бұрын
@@Codewrinkles I really love the way you explain things...I have learned so much since I started following you. I wouldn't worry about trying to condense things in your videos.
@JohnSmith-mm9yr
@JohnSmith-mm9yr 2 жыл бұрын
Your*
@Codewrinkles
@Codewrinkles 2 жыл бұрын
I disagree :)
@jakubmarcickiewicz774
@jakubmarcickiewicz774 2 жыл бұрын
Great video, thanks!
@Codewrinkles
@Codewrinkles 2 жыл бұрын
I'm glad you liked it.
Let's fix your EF Core exceptions in Blazor Server apps
29:56
Codewrinkles
Рет қаралды 2,4 М.
Colorful Pasta Painting for Fun Times! 🍝 🎨
00:29
La La Learn
Рет қаралды 308 МЛН
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 26 МЛН
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 16 МЛН
How to implement authentication in Blazor Server from scratch
57:22
Blazor Tutorial : Authentication | Custom AuthenticationStateProvider - EP12
29:46
CuriousDrive: Solve Coding Problems & Win Prizes!
Рет қаралды 63 М.
How to implement role based authorization in Blazor Server apps
17:46
Real-Time Notifications Using Blazor and SignalR from scratch
19:43
Milan Jovanović
Рет қаралды 36 М.
Top 5 Free Blazor Resources (plus a couple of extras)
17:32
IAmTimCorey
Рет қаралды 74 М.
Blazor Admin Page Tutorial (Roles, Policy, Claims)
1:04:00
Just Blazor Programming
Рет қаралды 16 М.
Colorful Pasta Painting for Fun Times! 🍝 🎨
00:29
La La Learn
Рет қаралды 308 МЛН