Authentication in Angular- AuthGuard | CanActivate | Role Auth

Sdílet
Vložit
  • čas přidán 12. 06. 2024
  • How to implement Authentication and Authorization in Angular. By using AuthGuards we can restrict users to access the routes also we can configure it base on the Role of the user.
    We take free Sessions on .Net Full stack training, if you guys are interested then you can join the telegram channel to get all the updates on training session.
    Telegram Link: LET'S PROGRAM
    t.me/letsprogramYt
  • Věda a technologie

Komentáře • 88

  • @deepakmoningi
    @deepakmoningi Před rokem

    Every time ur proving that ur a real genius 👌👌

  • @rushikeshjadhav6838
    @rushikeshjadhav6838 Před 2 lety

    very helpful for me.thank you so much!

  • @vigneshsridhar7252
    @vigneshsridhar7252 Před 3 lety +5

    Bro really your videos more neat and clear... please post more videos bro... you get more viewers and subscribers.

  • @lifetraveler8008
    @lifetraveler8008 Před 2 lety +1

    Thank you. Good explanation , very clear and precise

  • @kyleryxn
    @kyleryxn Před 2 lety +1

    In which video of yours do you go over JWT with Angular?

  • @suryaguthula6531
    @suryaguthula6531 Před 2 lety

    Thankyou Bro.awesome and very helpful video. Please make a video on Authentication &Authorization using JWT.Thankyou..

  • @roman-tp6sd
    @roman-tp6sd Před rokem

    Tnx from Argentina!

  • @maestro4704
    @maestro4704 Před 2 lety +1

    Hey, where can I find the whole video, with local storage and the login functions. Thank you so much

  • @akashjitnayak6947
    @akashjitnayak6947 Před rokem

    Nicely Explained.

  • @lucifer45227
    @lucifer45227 Před rokem

    awesome explanation .. can you please let me know if it is possible to have 2 can-activate() in1 auth guard

  • @rajaaqib2912
    @rajaaqib2912 Před rokem

    great explanation

  • @DK-1998
    @DK-1998 Před 2 lety

    Amazing!

  • @user-er6it2hx5b
    @user-er6it2hx5b Před rokem

    The video was very helpful.

    • @letsprogram30
      @letsprogram30  Před rokem

      Thank you thank you
      Do checkout my Blog : letsprogram.in

  • @trustingod0
    @trustingod0 Před 2 lety +6

    I have had a lot of experience and training in developing software. I was taught as well as it makes sense to just hide functionality from a user if they do not have access to it. unless some functionality is disabled until a certain condition is met like in the case of a submit button being disabled untill the form fields are valid, it greatly irritates a user when you show functionality that they cant use. Its just a psychological phenomena. So how do I hide things based on a users Role?

    • @blueSurfer
      @blueSurfer Před rokem +5

      you can use *ngIf with some conditions on div

    • @trustingod0
      @trustingod0 Před rokem

      @@blueSurfer Thanks !!!

  • @junevue9665
    @junevue9665 Před 2 lety

    Which video is the video tht shows u already made the login, main, signup

  • @karthikreddy5854
    @karthikreddy5854 Před rokem

    Keep Gng 💕👌

  • @jurivjerdha2467
    @jurivjerdha2467 Před rokem

    This is where you realise the hard part ins't coding but thinking your website out

  • @ramzirihane3612
    @ramzirihane3612 Před 2 lety

    Hello , i have data register in database how i can replace "localstorage.getitem('token') ?

  • @Careerquest2627
    @Careerquest2627 Před 2 lety

    Hi, this is very good one , but this is not matching with you previous login video, Please share git hub repo link.

  • @siphamandlakelengeshe6646

    Hi. Great tutorial! I just have one problem, when a user is on dashboard page and they remove the /dashboard, i want it to not work and take them back to dashboard. How do i do that?

    • @shibshankarpadhy783
      @shibshankarpadhy783 Před rokem

      You can use the router Service to navigate to any page that you like

  • @bharathgorental4928
    @bharathgorental4928 Před 2 lety

    this is awesome, but Can you please tell me If I want to restrict a user from a specific HTML element / typescript method/ function inside the component(some functions/ elements should be accessible but some should not), thank you.

    • @letsprogram30
      @letsprogram30  Před 2 lety

      You should use access modifier to achieve this

    • @prabhumath
      @prabhumath Před 2 lety +1

      follow the same tutorial and just add ngif to component u want to hide and call canActivate() like this: *ngIf="authGuard.canActivate()" , also import authguard in component.ts

  • @Amrendersingh
    @Amrendersingh Před 2 lety

    Sidhi baat no bakwas great. 👌

  • @nkyeeanot1347
    @nkyeeanot1347 Před 2 lety

    Very Helpful.. Thanks :)

  • @javaandpythonmadeeasy4489

    Well explained 🤌

  • @subitahai6330
    @subitahai6330 Před 3 lety +2

    Very good video, can I have the source code please?

  • @ImranAhmed-yp2sj
    @ImranAhmed-yp2sj Před rokem

    but admin can use,
    user components, how to deal with that?

  • @quicksees9773
    @quicksees9773 Před rokem +1

    Thank YOu 😉

  • @khusikar676
    @khusikar676 Před 2 lety

    Hiii....
    Can any one help me....???
    Reactive form----
    Curd...
    Select options....
    I m not abl to edit and bind the select....
    Plz help me..... ☹️☹️☹️☹️

  • @pranavkeshariya6049
    @pranavkeshariya6049 Před 2 lety

    How to create the login which u have created here

  • @brownwolfgaming4773
    @brownwolfgaming4773 Před 2 lety

    what backend stack do you use?

    • @letsprogram30
      @letsprogram30  Před 2 lety

      It's just fake creation without backend, just explained about what to do in frontend side

  • @bannerkong8847
    @bannerkong8847 Před 2 lety

    please put this full code in your description

  • @supriyasingh8477
    @supriyasingh8477 Před 2 lety

    😊😊😊

  • @codewithrohini1636
    @codewithrohini1636 Před 2 lety

    Where can I find the code?

  • @sudhakarkumar4553
    @sudhakarkumar4553 Před 2 lety +1

    please can u share the code

  • @AmitSingh-tf5yu
    @AmitSingh-tf5yu Před rokem

    hlw sir firstly u have to create a page step by step or u provide code...then this video is usefull

  • @ranaumer3076
    @ranaumer3076 Před 2 lety +2

    Bro can you please share the source code

  • @engineersexploring8543

    Hi brother Really nice video.. can I get access to the code ?

  • @jayakumar2927
    @jayakumar2927 Před 3 lety +1

    Telegram not to working

  • @AnkitYadav-xd3pi
    @AnkitYadav-xd3pi Před 3 lety +1

    This video is only for auth guards, please upload video for whole login functionality

  • @jeetadhikari3629
    @jeetadhikari3629 Před 9 měsíci

    Nice, but I think there is an issue.
    User can just put a random invalid jwt token in the localstorage through browser console, and will have access to internal pages.
    Rather, it is better to have an async auth guard, that will call the api with the jwt token, and if the token is valid, only then the auth guard will return true.

    • @letsprogram30
      @letsprogram30  Před 9 měsíci

      This is just for the demo purpose where there was no backend involved 🙂

    • @jeetadhikari3629
      @jeetadhikari3629 Před 9 měsíci

      @@letsprogram30 Yeah that makes sense indeed. May be its better to mention about this in your videos though, otherwise people end up making unsecured apps :D
      Btw, dont get me wrong, I am just giving feedback from audience POV. Great videos !

    • @letsprogram30
      @letsprogram30  Před 9 měsíci

      @@jeetadhikari3629 I highly appreciate your feedback bro🙂
      I will make sure next time to mention the same🙂🙏

  • @rajkumars4950
    @rajkumars4950 Před 2 lety

    Hi, i don't want show about us , contact page to other users. How can I do that?

    • @letsprogram30
      @letsprogram30  Před 2 lety

      Just check and store the session who has logged in and you can use *ngIf to hide

  • @roopalimattolia5921
    @roopalimattolia5921 Před rokem

    Can I do this if i have logged in using json-server ?? Please reply me... I need help

  • @PrudhviRoyals
    @PrudhviRoyals Před 23 dny

    How can we hide the about,contactus Component , instead of giving alert ?

    • @letsprogram30
      @letsprogram30  Před 18 dny +1

      Just make use that condition inside the template to hide and show using ngIf

  • @emad_arnesto9175
    @emad_arnesto9175 Před rokem

    can i make this method with keycloak authentification?

  • @s.balaji5016
    @s.balaji5016 Před 2 lety

    When I clicked logout still the token is present? And it going to main page. Have you faced this and solution please?

    • @letsprogram30
      @letsprogram30  Před 2 lety +1

      On logout method Just do localstorage.clear()

    • @s.balaji5016
      @s.balaji5016 Před 2 lety

      @@letsprogram30 thank you very much for your quick response

    • @letsprogram30
      @letsprogram30  Před 2 lety

      @@s.balaji5016 you're welcome 🙂

  • @krish8847
    @krish8847 Před rokem

    can u show me full source code for login and signup?

  • @malativanjarapu6115
    @malativanjarapu6115 Před rokem

    Can you please send me the source code of this

  • @sahilhadvani4424
    @sahilhadvani4424 Před 2 lety

    Hello, full project login with CRUD operation. 🙏🙏🙏

    • @letsprogram30
      @letsprogram30  Před 2 lety

      I do have video created on above mentioned topics

  • @mahdiayari9165
    @mahdiayari9165 Před rokem

    geat work !! source code please

  • @jack007jamesbond
    @jack007jamesbond Před 3 lety

    Source code? for the UI.
    The other video was good.

  • @workrelated851
    @workrelated851 Před 2 lety

    bro can share you project on github

  • @sateeshgedela7234
    @sateeshgedela7234 Před 2 lety

    Hi. Where is the code

  • @benankit2341
    @benankit2341 Před rokem

    Please add GitHub link also.

  • @mikha2880
    @mikha2880 Před 2 lety +1

    what backend stack do you use?

    • @letsprogram30
      @letsprogram30  Před 2 lety +2

      It's just fake creation without backend, just explained about what to do in frontend side

    • @mikha2880
      @mikha2880 Před 2 lety

      @@letsprogram30 oh i see, thank you my friend