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

  Рет қаралды 21,165

Codewrinkles

Codewrinkles

Күн бұрын

Пікірлер: 61
@skypinoify
@skypinoify 3 жыл бұрын
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 3 жыл бұрын
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.
@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..
@kaz00ie
@kaz00ie 2 жыл бұрын
Thank you so much! This works in my hybrid project. Greetings from Argentina :)
@Codewrinkles
@Codewrinkles 2 жыл бұрын
Great to hear!
@talkathiriify
@talkathiriify 3 жыл бұрын
Thank you so much for the excellent topic.
@Codewrinkles
@Codewrinkles 3 жыл бұрын
I'm glad you find it useful.
@fh61234
@fh61234 2 жыл бұрын
Life saver. Thank you!!
@Codewrinkles
@Codewrinkles 2 жыл бұрын
Glad it helped!
@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?
@TheLastRoseThatRaisedMe
@TheLastRoseThatRaisedMe Ай бұрын
if i wanna do global query filter to always add the tenantid. how can i get tenantid claim from user in a ef core service class?
@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_ Жыл бұрын
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.
@zohirbensalem7622
@zohirbensalem7622 8 ай бұрын
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
@ghevisartor6005
@ghevisartor6005 7 ай бұрын
does it also update the @page component itself for the [Authorize] attribute? so you get the NotAuthorized view on the whole page component?
@DavidThielen
@DavidThielen 6 ай бұрын
thank you - very helpful.
@manojnaik5643
@manojnaik5643 8 ай бұрын
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.
@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.
@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
@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 :(
@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.
@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.
@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?
@shabanelmogy7912
@shabanelmogy7912 8 ай бұрын
i need example if i use api and jwt with blazor server how can i implement RevalidatingServerAuthenticationStateProvider
@nithitsathornlak2721
@nithitsathornlak2721 2 жыл бұрын
Very useful, thank you so much.
@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 9 ай бұрын
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.
@leonardohidrovo4729
@leonardohidrovo4729 11 ай бұрын
What about using RevalidatingServerAuthenticationStateProvider when Identity Framework is not used?
@vanhutten1
@vanhutten1 2 жыл бұрын
Thanks, a lot of useful information
@muks8398
@muks8398 10 ай бұрын
Hey. Do you have a GitHub for this ?
@igorlaktic8891
@igorlaktic8891 2 жыл бұрын
Great stuff. Where we can download repo?
@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
@VästerHöger
@VästerHöger Жыл бұрын
Is authenticated and authorized being used synonymously here?
@VästerHöger
@VästerHöger Жыл бұрын
Just because I know who you are does not mean you get access to everything.
@MuhammadAshfaqSahil
@MuhammadAshfaqSahil 2 жыл бұрын
Excellent tutorial once again. Can you please share source code?
@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.
@DJosh-cs5vx
@DJosh-cs5vx 2 жыл бұрын
Thanks Code Wrinkles
@Codewrinkles
@Codewrinkles 2 жыл бұрын
No problem!
@giampaolotucci5897
@giampaolotucci5897 2 жыл бұрын
Excellent ! Tnx
@lozdbzmario
@lozdbzmario Жыл бұрын
THANKS MAN U DA BES
@donaldmafa
@donaldmafa 11 ай бұрын
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 8 ай бұрын
@@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 3 жыл бұрын
Your*
@Codewrinkles
@Codewrinkles 3 жыл бұрын
I disagree :)
@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 "
@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,5 М.
I'VE MADE A CUTE FLYING LOLLIPOP FOR MY KID #SHORTS
0:48
A Plus School
Рет қаралды 20 МЛН
Deconstructing Blazor (.NET 8) Authentication - Authentication State Provider
1:11:44
I just tried o3-mini
6:31
ThePrimeTime
Рет қаралды 233 М.
Blazor Server Components - Making Razor Components Easy to Use
42:23
How to implement role based authorization in Blazor Server apps
17:46
I'm Done With Content Creation!
14:39
Codewrinkles
Рет қаралды 3,4 М.
10 Signs Your Software Project Is Heading For FAILURE
17:59
Continuous Delivery
Рет қаралды 44 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 291 М.
Authorization in Server-Side Blazor | Blazor Tutorial 9
16:04
Nick Chapsas
Рет қаралды 21 М.
I'VE MADE A CUTE FLYING LOLLIPOP FOR MY KID #SHORTS
0:48
A Plus School
Рет қаралды 20 МЛН