Angular + Spring Boot JWT Authentication Example | JavaTechie

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

ความคิดเห็น • 103

  • @samurai7938
    @samurai7938 4 ปีที่แล้ว +4

    You are a mind reader. I have been looking for this. Thank you man.

  • @tutyjanreytingson8661
    @tutyjanreytingson8661 4 ปีที่แล้ว +11

    you don't need to disable cors() in spring security config actually.
    cause you already allowed specific origin so there's no point of disabling.
    Great video by the way.

  • @shashankmarri1056
    @shashankmarri1056 4 ปีที่แล้ว +3

    Excellent Video, entire JWT at one place. Please keep up the good work and continue to make such videos. God Bless you for your contribution and time.

  • @ankitgiri6874
    @ankitgiri6874 4 ปีที่แล้ว +6

    Please continue this video further for CRUD Operation demo.
    Thanks a lot, for explaining each and every line of code. Appreciated

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +3

      Thank you Ankit 😀 sure I will

  • @xX_dash_Xx
    @xX_dash_Xx 3 ปีที่แล้ว +1

    for anyone looking at the github for source code, the api call was switched to 9191 instead of 9192, so you will get CORS error when accessing the page. just change it to 9192 fyi

  • @obeyobey3838
    @obeyobey3838 4 ปีที่แล้ว +1

    thank you so much well explained! waiting for part2.

  • @issamachoiri9631
    @issamachoiri9631 4 ปีที่แล้ว +1

    Hi,
    At 20:38 you are trying to call subscribe inside subscribe and it IS not allowed.

  • @santoshthapa8032
    @santoshthapa8032 3 ปีที่แล้ว

    this dude is so much underrated

  • @dipanjanmaity6614
    @dipanjanmaity6614 3 ปีที่แล้ว +1

    How can I handle JwtException by using RestControllerAdvice class

  • @vidyesh1502
    @vidyesh1502 4 ปีที่แล้ว +1

    Nice..
    But where is @Bean for cors for spring as u mentioned in video? i cant find it in video description..

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Video description I mentioned GitHub link please go to that link and download the source codes

    • @vidyesh1502
      @vidyesh1502 4 ปีที่แล้ว

      Java Techie np..actually i typed the code when u full screen it into intellje

  • @OdiaMadBiker
    @OdiaMadBiker 4 ปีที่แล้ว +3

    Bro pls make video on login. Logout with refresh token and also ..how to deploy both the angular and spring into tomcat or any web server.

  • @weixiangng8279
    @weixiangng8279 8 หลายเดือนก่อน

    But for different page can use either localStorage/sessionStorage for storing the JWT token?

  • @RAJESHKUMAR-jh6bq
    @RAJESHKUMAR-jh6bq 4 ปีที่แล้ว +1

    Thanks for d video sir.. Pls upload the similar video on react

  • @weixiangng8279
    @weixiangng8279 ปีที่แล้ว +1

    I couldn't find your backend code for the spring boot jwt though in GitHub.

    • @Javatechie
      @Javatechie  ปีที่แล้ว

      I applied this frontend implementation in my old jwt backend video

    • @weixiangng8279
      @weixiangng8279 8 หลายเดือนก่อน +1

      Oh I see. Your tutorials are really nice to follow.

  • @vikaspooner9846
    @vikaspooner9846 4 ปีที่แล้ว +3

    please please please make this video with react also. Its request

  • @chiragmittal9267
    @chiragmittal9267 2 ปีที่แล้ว

    Really help full ❤

  • @selamawikahsai5664
    @selamawikahsai5664 2 ปีที่แล้ว +2

    greate content and greate explanition keep it up.
    I have one question for you, I was trying to make another API calls other than the welcome part by passing the token in the header,but I wasn't able to make it.Can you give me any suggestion How I could make other API Calls like the CRUD operation using this JWT?

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว +1

      What is the status code you are getting. Can you inspect the ui screen and tell me about the status code

    • @selamawikahsai5664
      @selamawikahsai5664 2 ปีที่แล้ว +1

      @@Javatechie thx for the response.it's not giving me any error actually. So if you could give me one example any api call in the CRUD operation other than the API call the Welcome method would be greate.

  • @rajeshsheela26
    @rajeshsheela26 4 ปีที่แล้ว +1

    Great explanation. Thanks for doing it.

  • @sabribouhaddi
    @sabribouhaddi 4 ปีที่แล้ว +1

    I'm getting the acces denied even if i pass my token in the headers , i downloaded your code from github and used your users and i have the same . always access denied ... do you have any idea about the problem ?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      In angular code just try to print token in console let's see whether are you able to generate token or not

  • @electricindro2236
    @electricindro2236 3 ปีที่แล้ว +2

    Can you please make a video on Angular Router Guard in collaboration with Spring Boot JWT for log in and log out?! This video was really helpful

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว +2

      Okay I will try

  • @KhiladiRocky
    @KhiladiRocky 4 ปีที่แล้ว +4

    Needed one, thank you😀... One more request, can u plz make a vidio on login to logout process like after click on logout button that token will expire. Angular + spring boot

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +3

      Ok will do

    • @KhiladiRocky
      @KhiladiRocky 4 ปีที่แล้ว

      @@Javatechie thank u

    • @talhapatel1218
      @talhapatel1218 4 ปีที่แล้ว +3

      I created E-commerce app with spring boot and angular with JWT authentication so any one u want to use source code u can use it or u can also suggest me any changes, this is my spring boot git url->github.com/talhapatel/Eommerce-spring-boot , angular code url -> github.com/talhapatel/ecommerce-frontend , i have only 1 yr as full stack developer so if i did any mistake then plz suggest me sir...
      my email ID : talhapatel.tp@gmail.com

    • @avinashsingh-tq1uq
      @avinashsingh-tq1uq 4 ปีที่แล้ว

      @@Javatechie Fabulous explanation.I am also waiting for the same request

    • @earthcitizen7156
      @earthcitizen7156 4 ปีที่แล้ว +1

      adding to above point sir
      plz do the refresh token and expiry time things as well.

  • @karusalaanil8032
    @karusalaanil8032 2 ปีที่แล้ว

    Hi, I have a doubt , where we need to save jwt token always, I mean stored to cookies or ?, Can u suggest me and I need to know how to protect jwt token

  • @vishalwalia8940
    @vishalwalia8940 4 ปีที่แล้ว +1

    @Java Techie I just have one doubt that when you created welcome(token){ } method in Angular service so the token is for any type or belongs to any class in angular?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Hi Vishal , it will be string type because token we were getting from.backend call

    • @vishalwalia8940
      @vishalwalia8940 4 ปีที่แล้ว +1

      Java Techie so does it belongs to any library or jwt api in angular?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      @@vishalwalia8940 this is the syntax to pass argument in ng method , you can specify the type if required

    • @vishalwalia8940
      @vishalwalia8940 4 ปีที่แล้ว +2

      Java Techie thanks for your reply. It was great help. I hope you to get millions subcribers.

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      Thank u Vishal 😀

  • @bmo9881
    @bmo9881 2 ปีที่แล้ว +1

    Do you have a video of authentication where username and password input need to match a user in a database?

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว +1

      Yes please refer this th-cam.com/video/-FZHBTqBGBM/w-d-xo.html

  • @akkulreddy5121
    @akkulreddy5121 3 ปีที่แล้ว +1

    Is there any tutorial on spring boot angular with okta security??

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      No but spring security and angular integration is there same way you can try .

    • @akkulreddy5121
      @akkulreddy5121 3 ปีที่แล้ว

      @@Javatechie basically there is one angular application in where we will be logging in using okta ..Which is giving us token by using this token i need to secure the microservice APIs which reside in another app

  • @laxmis6964
    @laxmis6964 3 ปีที่แล้ว +1

    Can you please upload a video oath2+jwt, your videos are helped me a lot

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Okay definitely I will try

  • @valix85
    @valix85 4 ปีที่แล้ว

    Which is previoua tutorial? Can you insert tutorial link about it in description? Thanks

  • @valix85
    @valix85 4 ปีที่แล้ว

    How it's possibile to persist token even if springboot is restarted? I must use something redis? I want to be able to invalidate some token by system administrator... Thanks

  • @PRADEEPKUMAR-rg5rf
    @PRADEEPKUMAR-rg5rf 4 ปีที่แล้ว +1

    Great explaination, please make video with REACT JS

  • @amalswain6860
    @amalswain6860 3 ปีที่แล้ว

    i have made /authenticate accessible with .permitAll()but still in postman it's saying 403 forbidden

  • @earthcitizen7156
    @earthcitizen7156 4 ปีที่แล้ว +1

    Hi Sir
    can u plz make a vudeo on angular and spring boot with security with different user roles (and permissions) accounts and show them on to access angular pages based on thier roles using JWT or Basic authorization concepts. Hope u will do in quick timem we will awaiting for ur new videos..

  • @techdevrpa
    @techdevrpa 4 ปีที่แล้ว +1

    Where is the video the teachs how to develop the api ?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Please checkout spring security jwt backend video

    • @techdevrpa
      @techdevrpa 4 ปีที่แล้ว +1

      Thanks very a lot dude ! You are very kindly!

  • @rahulgajbhiye5773
    @rahulgajbhiye5773 3 ปีที่แล้ว +1

    Where is spring-security-jwt-example repository code?

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Please checkout video description

  • @varuntiwari3565
    @varuntiwari3565 4 ปีที่แล้ว +1

    Hi, you helped me a lot. Thankyou. Can you please tell how to take those values of user name and password through a login form. It would be very helpful.

  • @sujith7931
    @sujith7931 3 ปีที่แล้ว +1

    Sir please add spring boot WebMvcConfigurer code in git hub.
    CorsConfigurer() is not there in spring security jwt example.
    Please update it

  • @abidinberkay1
    @abidinberkay1 4 ปีที่แล้ว +1

    where is the back end code and explanation of this project ?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      Please check in my channel spring security with Jwt , with same code I integrate frontend

  • @updownftw
    @updownftw 4 ปีที่แล้ว +1

    Thankyou for the tutorial :) Please add the Spring boot WebMvcConfigurer code in GitHub

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      It's there are you facing any issue

    • @updownftw
      @updownftw 4 ปีที่แล้ว +1

      Yes, I had a problem with CORS. But, it’s solved now. Thank you 😁

  • @bellilimohammedali527
    @bellilimohammedali527 4 ปีที่แล้ว

    can you give me the link of next part please ( form input of login and register )

  • @naoufalsarf9672
    @naoufalsarf9672 4 ปีที่แล้ว

    this is really helpful , sir can you make videos on how to display results on openMap or openStreetMap in Spring Boot

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      OpenMap and OpenStreetMap is something new for me I will check and update

  • @wisdomtohe
    @wisdomtohe 4 ปีที่แล้ว

    Nice tuto!
    Please can't find the api code on github

  • @gameplays997
    @gameplays997 3 ปีที่แล้ว +1

    Thank you sir :D

  • @g-l8492
    @g-l8492 4 ปีที่แล้ว

    you never use the token to get the welcome message, right?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      Yes I used , if you observe I added token in header section

    • @g-l8492
      @g-l8492 4 ปีที่แล้ว +1

      @@Javatechie Yes you're right, sorry about that! I'm new to Spring Security, but got it working now.

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      No problem 👍

  • @GiangNguyen-um8kz
    @GiangNguyen-um8kz 4 ปีที่แล้ว

    Please give CC in each video. I hear not well, pls.

  • @carlixprincipe
    @carlixprincipe 4 ปีที่แล้ว +1

    Thank you for this sir

  • @robertganditoru3261
    @robertganditoru3261 3 ปีที่แล้ว

    I am actually locking for a way to secure the password from the frontend.... :(, preferred if you did all that trough intercept but yea, that works to

  • @ekeshbahuguna8733
    @ekeshbahuguna8733 4 ปีที่แล้ว

    Good explanation, if you put that @CrossOrigin(origins = "*") on the server-side controller itself, It does not even required a workaround for handling cross origin request.

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      Hi Ekesh, I tried it but didn't work for me so till now I didn't figure out this issue .
      Can you suggest something , same code if I ran on different machine by using @CrossOrgin("*") it is working .but not in my machine 🤪

    • @ekeshbahuguna8733
      @ekeshbahuguna8733 4 ปีที่แล้ว

      @@Javatechie In your code you are just sending the response as string, I faced the same problem while I was doing so. Then after reading preflight error I thought of returning ResponseEntity.ok("msg") from controller. And it worked out for me. Most probably http status is required for options call. Hope it helps 😀

    • @ekeshbahuguna8733
      @ekeshbahuguna8733 4 ปีที่แล้ว

      @@Javatechie Even this doesn't worked out just add @CrossOrigin(origins = "*", allowedHeaders = "*") over controller.

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว +1

      @@ekeshbahuguna8733 great I will try this, thank you

  • @tejasnambiar5490
    @tejasnambiar5490 2 ปีที่แล้ว +1

    Hi sir, thanks for the video explanation. My fundamentals got cleared. Was able to find solution for CORS is java. I just wanted to understand one thing. Initially, I tried putting the link directly i.e "localhost:9192..." and initially said cors blocked, but when i added "http:localhost:9192...." it started to work. Can I know why when i pass this "localhost:9192/authenticate" its throwing cors blocked and where as link "localhost:9192/authenticate" is allowing?

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว +1

      You enabled crossorigin from backend that's why it's allowing you .

    • @tejasnambiar5490
      @tejasnambiar5490 2 ปีที่แล้ว

      @@Javatechie yes, i understood that part, using Bean was did. But just could u clarify more specifically, why for http it is, as I saw that it had mentioned in error later that https isn't allowed in cors, so want to understand if by default localhost uses https? Cause like I said manually adding http enables cors but when I don't write http: localhost and only write localhost, it throws error.

  • @naveenkandimalla5514
    @naveenkandimalla5514 4 ปีที่แล้ว +1

    Great one

  • @chenna12
    @chenna12 2 ปีที่แล้ว +1

    Can you pleas provide me git source code for ur in this application in git hubb

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว

      Please check in video description

  • @shivaaloneforever
    @shivaaloneforever 3 ปีที่แล้ว +1

    Thank you brother

  • @abhishekmahanthsingh5556
    @abhishekmahanthsingh5556 4 ปีที่แล้ว +1

    Great

  • @electricindro2236
    @electricindro2236 3 ปีที่แล้ว

    Can you please share the updated backend code? Couldn't find the latest code with CORS configured in GitHub. Thanks.

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว +2

      Please go through this
      github.com/Java-Techie-jt/spring-security-jwt-example

  • @leno_tc_1
    @leno_tc_1 4 ปีที่แล้ว

    why you make a course on udemy ?

    • @Javatechie
      @Javatechie  4 ปีที่แล้ว

      I don't have any single video in udemy

  • @prashanttiwari752
    @prashanttiwari752 4 ปีที่แล้ว

    really helpful!

  • @ankitagarwal4469
    @ankitagarwal4469 ปีที่แล้ว

    No explanation of any code and flow..looks like he learned the steps only...just doing spoon feeding...

  • @KyivanEnjoyer
    @KyivanEnjoyer 4 ปีที่แล้ว +1

    How to keep calm with this shit pronunciation?