Spring Security 6 | How to Create a Login System with Spring Data JPA and JWTs [NEW 2023]

Поділитися
Вставка
  • Опубліковано 23 лип 2024
  • Spring Security can be a massive rabbit hole when you get started. This is exactly what happened to me when I started researching how to add encryption to the backend of my Twitter clone here on UA-cam. I poured hours and hours of watching tutorials and trying to figure out how to tweak one tutorial to do this, or another tutorial that was outdated to do that. Finally, I stumbled upon some non-outdated tutorials, but they still lacked exactly what I needed and I still had to link multiple different tutorial videos together to get to where I am now. If you have been in my place before, or if you are at where I was right now this is the video for you.
    In this video we are going to sit down from the start of an application and build out an entire authenticated backend server with login and register features connected to a database. We are also going to implement the generation of JWT's so you can have a stateless backend, and we will use OAuth2Resource server to verify that the JWT's sent back are valid, and then authorize requests to specific routes based on the users roles. We will do all of this from scratch so you can understand where we started and how we got to the finish line.
    I highly recommend that you watch through the entire video for context, however, here is the link to the project code:
    github.com/unknownkoder/sprin...
    ~~~ Feeling Generous? Donate to the channel for the all the hard work that made this video ~~~
    streamlabs.com/unknownkoder/tip
    ~~~ Stay Up To Date With My Social Media ~~~
    Twitter: / unknownkoder
    Twitch: / unknownkoderyt
    Be sure to subscribe and turn on the bell notifications on youtube to not miss another episode of Lets Build Twitter: shorturl.at/gnxZ8
    ~~~ Background Music Used In My Video ~~~
    Astroblk - Nothing Really matters that much to me anymore
    Aviscerall - Sanctuary
    Cøzybøy - Please Don't Drown
    Astroblk - explorer
    Knwln Ryan - Can't Replace You
    NetNavi - How Can You Tell
    Astroblk - Vancouver
    Aviscerall - Lullabyes
    Cøzybøy - Deep In Snow
    Astroblk - Courage
    Aviscerall - Coffee Shop
    Cøzybøy - I'll Do Anything
    Astroblk - Pay Up _____
    Aviscerall - Chillin'
    Cøzybøy - I Feel Okay Today
    Astroblk - fleids
    Aviscerall - Progress
    Cøzybøy - What Do You know About Love
    Astroblk - Geneva
    Knwln Ryan - Jupiter
    Astroblk - Ginger Spice
    Aviscerall - Clockin' Out
    Knwln Ryan - Waterfalls
    Aviscerall - Feelings
    Astroblk - Soul in Seoul
    NetNavi - To A Song
    Astroblk - Sunrise
    Aviscerall - Onett
    ~~~ Video Content ~~~
    0:00:00 - Introduction
    0:03:05 - Prerequisites
    0:04:34 - Project Diagram
    0:06:05 - Project Creation
    0:12:01 - application.properties setup
    0:17:04 - Creating the UserController
    0:19:56 - Creating the AdminController
    0:21:32 - Testing User and Admin Endpoints
    0:22:37 - Installing Spring Security
    0:24:43 - Utilizing the default Spring Security password
    0:25:57 - Unlocking the API
    0:28:45 - Creating the Role model
    0:32:26 - Creating the ApplicationUser model
    0:38:32 - Creating the UserService
    0:42:20 - Configuring basic authentication
    0:47:38 - Creating the Repository layer
    0:51:20 - Loading Roles and Admin User
    0:55:13 - Using the UserRepository in the UserService
    0:58:05 - Creating the AuthenticationService and registerUser method
    1:04:12 - Creating the AuthenticationController and registerUser method
    1:09:22 - Configuring all traffic to AuthenticationController
    1:11:53 - Creating the KeyGenerator utility class
    1:14:37 - Creating the RSAKeyProperties class
    1:16:21 - Installing OAuthResourceServer
    1:17:29 - Configuring Spring Security to use OAuthResourceServer
    1:22:05 - Creating the TokenService
    1:26:54 - Creating the LoginResponseDTO class
    1:28:37 - Creating the loginUser method in AuthenticationService
    1:32:52 - Creating the loginUser method in the AuthenticationController
    1:34:11 - Testing user login
    1:36:23 - Configuring role based authorization
    1:42:44 - Testing role based authorization
    1:43:52 - Outro
    #unknownkoder #javaprogramming #springsecurity

КОМЕНТАРІ • 300

  • @kelvinwarui2982
    @kelvinwarui2982 Рік тому +45

    You had me in the first 20 seconds , tutorial hell has brought me here i was almost loosing my mind on spring security

  • @sajithkumarganesan9823
    @sajithkumarganesan9823 10 місяців тому +3

    Fantastic Video, Thank you for putting all this together in one place and having it explained very clearly and at a steady pace. Great work!!!

  • @aman_deep21
    @aman_deep21 Рік тому +10

    What a fantastic to the point video it is, Thank you so much Ethan for sharing valuable knowledge with all of us, my knowledge before and after watching this video has increased very much, looking forward to more of your videos.
    I had watched a bunch of videos on this topic, but your explanation made it much easy to follow and code along with you.

  • @romanlobko1293
    @romanlobko1293 8 місяців тому +1

    Amazing video! Such a complex topic was explained in a relatively simple way, thank you!

  • @professionalyoutubevideowa37
    @professionalyoutubevideowa37 8 місяців тому

    Excellent tutorial. This is just what I needed to get started.

  • @pranavthakkar2720
    @pranavthakkar2720 6 місяців тому

    The Best explanation I have even seen for spring security and jwt authentication. Thanks alot.

  • @maz1ogra
    @maz1ogra 10 місяців тому +2

    This video is a compilation of everything useful that is said in the other videos, discarding all the other useless things that are said, updating it to the latest versions of spring.
    Liked the video, keep it up.

  • @kheydbeats
    @kheydbeats 10 місяців тому

    It was indeed an absolute Behemoth of a video! Great tutorial, loved the pacing and the explanations. My subscribe and like is your good sir.

  • @superkobke
    @superkobke 10 місяців тому +3

    Well done. Had some troubles with dependencies but overall your video is quite amazing! Thank you so much!

  • @daffarandika3148
    @daffarandika3148 3 дні тому

    clear and concise, great video mate!

  • @pradeepk2864
    @pradeepk2864 11 місяців тому +1

    perfect video, everything will go smoothly without getting any blocker for me, thanks brother for such a nice video😍

  • @mohssinedardar410
    @mohssinedardar410 10 місяців тому +1

    Thank you so much! I highly recommend this video to anyone who wants to learn about Spring Security. It is a comprehensive and informative resource :)

  • @cydoentis
    @cydoentis Рік тому +26

    This video hit the nail on the head, I watched countless other videos from other people before I found this one, and the content was either outdated or poorly explained. I appreciate that you did everything from scratch and explained each step. Wish I found this video about 8 videos earlier, but I finally understand the whole implementation process for Jwt's. 11/10 will watch again.

  • @shauryatomer1058
    @shauryatomer1058 2 місяці тому

    Thanks, for this great tutorial. Concise and blazingly fast.

  • @maelina2222
    @maelina2222 Місяць тому

    This is a really great tutorial. Thanks for this

  • @vsaihruthikreddy7127
    @vsaihruthikreddy7127 5 місяців тому +1

    All I could say this is an extraordinary tutorial. I tried all of the spring security tutorials but they did not cover the nitty gritty aspects of it like the jwt token creation and authorization but you just were superb. Thank you very much for uploading a gem ❤

  • @user-bm3ip7rg9i
    @user-bm3ip7rg9i 5 місяців тому

    Absolutely amazing video, learned a lot from this, Thanks!!

  • @CarlosSousa-cq3jc
    @CarlosSousa-cq3jc 2 місяці тому

    After thousands of videos on spring security, I finally found an excellent one

  • @existence_zero1692
    @existence_zero1692 Рік тому

    This video is the best spring security video ❤

  • @kumar-mh6hy
    @kumar-mh6hy 10 місяців тому

    great content video with proper explanation keep doing contents like this 😍, i was looking for this type content for many days, i just wasted a lot of time but this saved my time and can explain how to save roles in DB annd retrieve it from DB and also about OAuth 2.0

  • @adarshpandey8526
    @adarshpandey8526 7 місяців тому +7

    You just revived my passion for spring boot based backend development. Thank you so much. This is the best spring security crash course I've found on UA-cam even better than the inspirations you mentioned in this video. The reason is, that you used less jargon and fancy Java. You showed basic Java skills to explain an already complex spring security concept which feels smooth.
    Most of the creators from the Java community tend to use a lot of fancy Java design patterns and advanced Java features which causes great difficulty for freshers to understand such complex concepts.
    Constructive Criticism:
    I have one small suggestion for you, the cutting of your voice is really not good. There are no pauses between your speech, leading to you sounding monotonous even when you're not. Also, it made me rewind many times since I never understood where one sentence ended and the other began.
    Love your content. keep going ♥

  • @curiosabouttech
    @curiosabouttech 10 місяців тому

    Thank you so much after searching alot i found this video that covered my ground up spring security and jwt thank you man.

  • @koffeetalk
    @koffeetalk Рік тому +2

    Wow, first time I get it right. Thank you! This channel should have much more followers.
    I had some issues using Lombok, but when I did all the constructors, getters, setters manually it's finally worked! I guess I need more experience with constructors first, then use lombok.

    • @unknownkoder
      @unknownkoder  Рік тому +3

      I have also had issues with Lombok and I know others sometimes do as well. That is why I chose not to use it in this video.

  • @anurp4173
    @anurp4173 7 місяців тому

    Wow, you had me in the first 20 seconds. Got the problem absolutely spot on. thanks

    • @anurp4173
      @anurp4173 6 місяців тому

      I have done exactly as you have mentioned in the video upto configuring basic authentication, I keep getting 401 unauthorized exception despite supplying the username and password correctly

  • @cod4basterd
    @cod4basterd 9 місяців тому +10

    Holy crap. Thank you so much; this is amazing. Top tier content. I learned so much from this compared to hours of Amigoscode or Dan Vega. Nothing against those guys, they just have so much content to get through and a lot of it is outdated. Thank you so much for putting this together. I got what I needed out of it and then some.

  • @randomforest_dev
    @randomforest_dev Рік тому

    thanks for this awesome tutorial! very helpful!

  • @podcasts.clips.delivery
    @podcasts.clips.delivery Рік тому

    Brother, you are a lifesaver!

  • @malbunb
    @malbunb 7 місяців тому +2

    This is a greate tutorial. Thanks for that!

  • @olliDeg
    @olliDeg 9 місяців тому

    Great video, really helpful!

  • @DarkHid3
    @DarkHid3 5 місяців тому

    Good video, I watched it to the end, kinda hard to understand the whole thing because I've just started learning this framework but with the time for sure I will comeback and watch it again!

  • @alexbrun6863
    @alexbrun6863 10 місяців тому +1

    Absolute legend for making this

    • @andtif
      @andtif 8 місяців тому +1

      GOAT

  • @SailBuddha
    @SailBuddha 7 місяців тому

    This was fantastic! I followed it, but changed JPA to jdbcTemplate, because the road to Hell is paved with too much abstraction. Doing it that way, everything made perfect sense. Thank you!

  • @tylerljohnson
    @tylerljohnson 8 місяців тому

    excellent tutorial, and thank you for the timestamps!

  • @sherlockholmes1605
    @sherlockholmes1605 11 місяців тому +8

    Liked the video! Here's an idea for future tutorials, can you create git branches for each chapter? this way we can go back and forth between different chapters to compare and contrast the changes.

  • @fetterollie54
    @fetterollie54 11 місяців тому +7

    Great video and working around the deprecated methods wasn’t too bad and was a very good practice of working with documentation. Thanks for putting this all together. 👏🏼👏🏼👏🏼

    • @mathewfrancis4167
      @mathewfrancis4167 9 місяців тому

      how did you get the JwtAuthenticationConverter to work in the SecureityFilterChain ?

    • @fetterollie54
      @fetterollie54 9 місяців тому +1

      @@mathewfrancis4167 I’ll check in a bit and get back to you

    • @mathewfrancis4167
      @mathewfrancis4167 9 місяців тому

      @@fetterollie54I'll be infinitely great-full when you will :)

    • @fetterollie54
      @fetterollie54 9 місяців тому

      @@mathewfrancis4167
      Not sure if you can put code blocks in here:
      @Bean
      public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{
      http
      // disable cross site request forgery
      .csrf(csrf -> csrf.disable())
      // any http requests are authorized
      .authorizeHttpRequests(auth -> {
      auth.requestMatchers("/auth/**").permitAll();
      auth.requestMatchers("/admin/**").hasRole("ADMIN");
      auth.requestMatchers("/user/**").hasAnyRole("ADMIN", "USER");
      auth.anyRequest().authenticated();
      });
      http
      .oauth2ResourceServer((oauth2) -> oauth2.jwt(jwt -> jwt.jwtAuthenticationConverter(jwtAuthenticationConverter())));
      http
      .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
      // build into security chain
      return http.build();
      };

    • @fetterollie54
      @fetterollie54 9 місяців тому +1

      Also I stepped away from the project a month ago and haven’t looked at it since. Hope this is what you are looking for…

  • @Justin_Jay
    @Justin_Jay 9 місяців тому

    Wow. Thank you for this. Brilliant

  • @Justsomeguy492
    @Justsomeguy492 Рік тому

    thanks for a clear video. its incredible how spring security team has no good documentation for spring security 6

  • @duri467
    @duri467 3 місяці тому

    mega tutorial man, THANKS !

  • @user-ds9yw9km9w
    @user-ds9yw9km9w 3 місяці тому

    Wonderful! Thanks!

  • @user-uk7bd2nq8c
    @user-uk7bd2nq8c 11 місяців тому

    Thank You! That was very helpful

  • @khacthinh23.06
    @khacthinh23.06 8 місяців тому

    tôi mới học khá lúng túng với spring security nhưng xem hết video của bạn tôi đã hiểu hơn rất nhiều, cảm ơn video của bạn.

  • @rashidcollins6337
    @rashidcollins6337 8 місяців тому

    one of the best security tutorial, clear explanation, am now confidence about spring security. Thank you @Unknown Coder

    • @yogeshpatel2463
      @yogeshpatel2463 8 місяців тому

      my project is not running bro

    • @iuliszekely8397
      @iuliszekely8397 8 місяців тому

      Can you help me with something? I got stuck at some point

  • @bojidaryordanov2035
    @bojidaryordanov2035 8 місяців тому

    Insane video. Ty so much

  • @harshpratapsinghshekhawat3034
    @harshpratapsinghshekhawat3034 10 місяців тому

    Much needed video on the upgraded ways of Spring Security, I'm glad that i was able to find it
    I have a request though, could you also post a video on formLogin using spring security

  • @sasaprograma
    @sasaprograma Рік тому

    Great content, thanks a lot!!

  • @michasasua8977
    @michasasua8977 8 місяців тому

    thank you for you effort, great job!

  • @RotorVideos01
    @RotorVideos01 5 місяців тому

    Thank you for the video!

  • @BeneTanStarcraft
    @BeneTanStarcraft Рік тому

    Thanks for this video!

  • @Mihai-mb4ew
    @Mihai-mb4ew 7 місяців тому +2

    Man, this video is top notch. It is exactly what was missing from youtube. Could you, please, share with us, how did you figure all this out? What materials did you use for documentation or how was your thought process? Or maybe is it just experience? I watched Dan Vegas' video about JWT and I was really wondering how to achieve role authorization. I wouldn't have figured it out by myself.

  • @mr_bla_
    @mr_bla_ Рік тому +1

    fantastic video thanks lot

  • @kvittitoe
    @kvittitoe 9 місяців тому

    fantastic video

  • @codex8797
    @codex8797 6 місяців тому +1

    Thank you so much bro, you are a life saver

  • @mrowox
    @mrowox 11 місяців тому +6

    What I usually want to see in security videos is handling security for different type of roles. E.g a backend service for sellers and buyers, drivers and riders, students and teachers and so on

    • @jhonandersonperaltaochoa9833
      @jhonandersonperaltaochoa9833 11 місяців тому

      lo que tu quieres es manejo de roles

    • @anywho3934
      @anywho3934 11 місяців тому +2

      hey have you figured it out ? any other resources you found ? cause I have to implement it in project

    • @MyBinaryLife
      @MyBinaryLife 8 місяців тому +2

      this logic is implemented in the SecurityFilterChain bean in your security configuration class

  • @bryanantoine8911
    @bryanantoine8911 11 місяців тому

    great video helped me a lot

  • @user-my9yc3bi8o
    @user-my9yc3bi8o 7 місяців тому

    This video is amazing

  • @togashi-azul
    @togashi-azul 4 місяці тому

    Very good video

  • @ajaythombare6235
    @ajaythombare6235 7 місяців тому +3

    Spring Security is confusing but you did a great job.
    I found a lot of things in one place it helped me a lot.
    Thanks

  • @manishareddy1
    @manishareddy1 6 місяців тому

    Great Video..Thank you so much

  • @fahrican9708
    @fahrican9708 11 місяців тому

    great video!

  • @vatana7
    @vatana7 Рік тому

    Thank you for your tutorial

  • @oshannanayakkara6187
    @oshannanayakkara6187 5 місяців тому

    Bro this is golden

  • @abdelmoneimelshafei6570
    @abdelmoneimelshafei6570 10 місяців тому

    Big thanks, Sir 🥰🥰🥰

  • @MathiasDurrenberger
    @MathiasDurrenberger 6 місяців тому

    Well done. A 1000 thanks

  • @amitgrover1992
    @amitgrover1992 Рік тому +2

    Thank for the detailed explanation, please suggest how to do authentication for an application using Thymeleaf and MVC controller.

  • @t0khyo
    @t0khyo 9 місяців тому

    Toturial hell got me here bro 🗿👍🏿

  • @kwamekyeimonies
    @kwamekyeimonies 9 місяців тому

    Yeah, very true.about 80% of the videos sessions use deprecated modules

  • @theominarinidemelo756
    @theominarinidemelo756 11 місяців тому

    TU É FODA MAN, VC É INCRIVELLLLLLLL

  • @luciano5026
    @luciano5026 4 місяці тому

    Thank you !!!!

  • @aashirsiddiqui177
    @aashirsiddiqui177 Рік тому

    Thanks for the vid, the deprecated APIs were a pain in the ass!

  • @paypalmymoneydfs
    @paypalmymoneydfs Рік тому +1

    It really was legit hell, YT algorithm was hiding you from me too 😂

  • @abdelkadermiladi5647
    @abdelkadermiladi5647 6 місяців тому

    THANK YOU

  • @sfgmbkmbksfg3722
    @sfgmbkmbksfg3722 5 місяців тому

    Mind blowing

  • @sabinsesumariyan3687
    @sabinsesumariyan3687 7 місяців тому

    very good content

  • @AhmetMurati
    @AhmetMurati 11 місяців тому

    in first minutes I subscribed

  • @gaddp
    @gaddp 11 місяців тому

    sick hoodie man

  • @maingawesley8212
    @maingawesley8212 5 місяців тому

    Trust me I haven't started this tutorial, I just read the description and I know Spring Security is bagged already😆😅

  • @apurvasaha8871
    @apurvasaha8871 10 місяців тому +3

    Finally found a video for working around the older deprecated methods. Thank you very much.
    Edit:
    Unable to generate the jwt token during login, and getting a 401 Unauthorized error response back.
    Might be an issue with the deprecated jwt() method in oauth2ResourceServer(oauth2ResourceServerConfigurer::jwt()).
    But even with the new code oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) which provides a default implementation of the oauth2ResourceServerConfigurer class its not working.
    If anyone has faced the same issue and solved it, Please let me know. Thank you.

    • @TheMrBatica
      @TheMrBatica 10 місяців тому +1

      I had exact the same issue but I skipped the line 'daoProvider.setPasswordEncoder(passwordEncoder());' under SecurityConfiguration class -> AuthenticationManager ... i had only "daoProvider.setUserDetailsService(detailsService);" hope it helps.

    • @manmitapatnaik2513
      @manmitapatnaik2513 9 місяців тому

      Yes please help in this. I am facing the same issue in intellij.

    • @manmitapatnaik2513
      @manmitapatnaik2513 9 місяців тому

      ​@@TheMrBaticaBut here daoAuthenticationProvider.setUserDetailsService(detailsService) is used . So what did you exactly change

    • @TheMrBatica
      @TheMrBatica 9 місяців тому

      I wrote what was my problem. I didn't have -> 'daoProvider.setPasswordEncoder(passwordEncoder());

    • @bochunator1173
      @bochunator1173 4 місяці тому

      @@TheMrBatica Thanks, I had the same problem. Maybe someone has the same issue, so here I put proper code: @Bean
      public AuthenticationManager authManager(UserDetailsService detailsService) {
      DaoAuthenticationProvider daoProvider = new DaoAuthenticationProvider();
      daoProvider.setUserDetailsService(detailsService);
      daoProvider.setPasswordEncoder(passwordEncoder());
      return new ProviderManager(daoProvider);
      }

  • @KuldipGhotane
    @KuldipGhotane Рік тому

    It was brilliant, please add oauth 2 support for the same repo

  • @KieranMueller
    @KieranMueller 11 місяців тому +4

    fyi if you are struggling with deprecated methods, or other things (example: I was unable to run project due to an error with the security filter chain method, request matchers specifically. You can always just downgrade the version of Spring Boot in your POM.xml to use what was used in the video and everything will work.

  • @user-zs7nn9fl1e
    @user-zs7nn9fl1e 10 місяців тому

    best ever

  • @Ayman_youtube
    @Ayman_youtube 5 місяців тому

    thank you

  • @mathewfrancis4167
    @mathewfrancis4167 9 місяців тому +1

    Lovely just what i needed ... i'm new to this level of spring security ... so I hope this question isn't a silly one ... i would like to know how and where you generated the public and private key in you code... thank you :)

  • @kaydanderson4487
    @kaydanderson4487 9 місяців тому

    Awesome video, I followed everything you said (mostly) and got postman working at the end, but Im a bit confused on how to implement a login page and move to a secured page?

  • @bajrangchapola6748
    @bajrangchapola6748 6 місяців тому

    Great Content!!! Can you make a video on how this authentication backend works with API gateway ? Any of the members if know

  • @Blazs120gl
    @Blazs120gl 8 місяців тому

    Hi, this was an exhaustive example I've been looking for. Thank you very much!
    I would like to extend this project with static HTML pages. How can I do that?
    I've added HTML pages (e.g. an index.html under resources/static) but I can't access any of the pages. they're all blank and I get 401 responses to them.
    I tried to add the static path to auth request matchers, but no joy so far. Any ideas what's missing? Thanks in advance!

  • @Abdrabbo1
    @Abdrabbo1 8 місяців тому

    thank you sooooooooooo much!

  • @QmGhq2T7CzQ
    @QmGhq2T7CzQ 10 місяців тому

    I am using DOMA, I can't declare the Set authorities as it says it is not supported as persistent type.

  • @michaels2048
    @michaels2048 6 місяців тому

    Thank you for the video, do you know how i can be able to display this information in my next js project

  • @jumaiddotuya2797
    @jumaiddotuya2797 11 місяців тому

    There is a problem casting the Principal to UserDetails as per your implementation.. any ideas? Am trying to get the logged in user via SecurityContextHolder.. thanks

  • @sidof8065
    @sidof8065 Рік тому

    I how to do to allow user to access and resource when his already been logged. and don't have toprovide access token again on the frond end?

  • @billyburroughs2136
    @billyburroughs2136 Рік тому

    Hi!
    When I run the Maven app and try and access an endpoint in browser I get: “Request Method ‘GET’ is not supported.
    Do you know what could be causing this?
    The only difference between yours is I am using Postgres driver.
    Thanks!

  • @TheQuancy
    @TheQuancy 10 місяців тому

    I'm trying to do this with MongoDb as the database, and I lose myself when i end up trying to create the roles. Since MongoDb isnt a relational db, its a little confusing when im trying to make "join tables"

  • @user-qd5vb1hh9i
    @user-qd5vb1hh9i 4 місяці тому

    Greate tutorial,
    Am asking for getting an end-point which returns an access token by accepting refresh token, Note Access token should also be returned on login attempt.

  • @mrowox
    @mrowox 10 місяців тому

    From your implementation, how will it be possible to add permission to a users roles? from what I can see, there can only be one authority/permission. I am not too clear on that part.
    Also previous videos I have seen usually have a secret in the application.properties file that the jwt encoder uses. why dont we have that? is it because we are using the RSA encryption thing? if you have links that explain this in springboot context, I will appreciate if you can share it.
    I also did notice one downside in that if the application restarts, users have to login again. Can you explain why this is so?
    And for some reasons, when I try to log the currently logged in user using @AuthenticationPrincipal, I get an error

  • @sanctusfides
    @sanctusfides 3 місяці тому

    Is there any need for the JWT Auth Converter to set the roles to "ROLE_ROLENAME" if you just set the roles in the DB to be begin with "ROLE_"?

  • @Mihai-mb4ew
    @Mihai-mb4ew 7 місяців тому

    Hey guys! Is it normal for role authorization to not work without a Converter even if we set the role in DB as ROLE_ADMIN for example? Because I just spent a lot of time with it and it did not work at all even if I would use roles such as "ROLE_USER", "ROLE_ADMIN". It began working only after setting the roles in DB as simply "ADMIN" and "USER" then adding the converter as in the video.

  • @akshaybhoendie
    @akshaybhoendie Рік тому +1

    Hi would you be kind to show the logout part?

  • @sakthinivas1840
    @sakthinivas1840 9 місяців тому

    Whats the tool being used to create the architectural diagram in your video?

  • @QmGhq2T7CzQ
    @QmGhq2T7CzQ 10 місяців тому

    Now I am experiencing dependencies cycle from AuthenticationService to SecurityConfiguration with the AuthenticationManager. How am I fix this?

  • @luky7143
    @luky7143 3 місяці тому

    Do I understand it correctly that in the client after login i need to save the token from server response and put it to every request made afterwards?