OAuth2 Login Made Easy in Java: A Spring Boot & Spring Security Walkthrough

Поделиться
HTML-код
  • Опубликовано: 27 апр 2023
  • Are you looking to implement OAuth2 login in your Java application but feeling overwhelmed by the complexity? Look no further! In this video, we'll take a quick dive into the world of OAuth2 authentication using Spring Boot and Spring Security.
    🔗Resources & Links mentioned in this video:
    GitHub Repo: github.com/danvega/spring-sec...
    👋🏻Connect with me:
    Website: www.danvega.dev
    Twitter: / therealdanvega
    Github: github.com/danvega
    LinkedIn: / danvega
    Newsletter: www.danvega.dev/newsletter
    SUBSCRIBE TO MY CHANNEL: bit.ly/2re4GH0 ❤️
  • НаукаНаука

Комментарии • 154

  • @poloolo69
    @poloolo69 День назад

    you are the realest one so incredibly concise and high quality tutorials! love your content

  • @folicreppy5592
    @folicreppy5592 Год назад +16

    Another banger of a tutorial. Thanks for the vid! I'm definitely interested in a tutorial focused on customizing the login page. I'd also be interested in a longer-form React/Angular + Spring Boot + some noSQL DB tutorial if that's a stack you're into! Thanks again!

  • @paulnzioki8782
    @paulnzioki8782 Год назад +14

    Hi Dan, thank you for the great tutorials you make for us! 👊 [We] are definitely interested in a tutorial on how to override the default login screen.

  • @ger1991mess
    @ger1991mess 9 месяцев назад

    Awesome! Thank you very much from the bottom of my heart, I am learning Spring and this saved my week.

  • @saidelhabchi5505
    @saidelhabchi5505 Год назад +1

    Thank you for this tutorial.
    Customizing this with a frontend library is a need tbh

  • @anthonysox2001
    @anthonysox2001 11 месяцев назад +2

    Great tutorial. Definitely would love the login page with angular and tailwind.

  • @mrowox
    @mrowox Год назад

    Thank you so much for this tutorial. I am really looking forward to the tutorial on how to customize the form login. Thank you once again. Cheers

  • @arielcastillo7925
    @arielcastillo7925 7 месяцев назад

    thanksss, i think that you are the only making this sort of videos about spring boot jeje, very thanks!!

  • @svalyavasvalyava9867
    @svalyavasvalyava9867 7 месяцев назад

    Wonderful tutorial, thank you ☺️

  • @ornelfranck
    @ornelfranck 10 месяцев назад

    Niiiiiiiiiiice!!!!And yes customizing the login page would be definitely amazing.

  • @arjunshaji8856
    @arjunshaji8856 Год назад

    Love form KERALA !!! Good video Dan! Thank you.

  • @vaibhavchaudhary5423
    @vaibhavchaudhary5423 9 месяцев назад

    Informative video. Thank you so much.

  • @marzuraanmarzuraan1226
    @marzuraanmarzuraan1226 Год назад

    9:47 Thank you so much for this walkthrough, Dan! I have one question, though. What if it's not a web application, like in your youtube CLI video with spring shell? Am I right to assume that you would have to select 'Desktop app' instead of 'Web application' from the 'Application type' drop-down then? And how does the code change then, if it does at all?

  • @deepanshuganotra4088
    @deepanshuganotra4088 7 месяцев назад

    Nice concise explanation

  • @m_i_g_u_e_l_
    @m_i_g_u_e_l_ Год назад

    Best teacher ever. Thank you so much

  • @geosystems2106
    @geosystems2106 9 месяцев назад +2

    This one was great 👍👍 yet 2 possible extensions : 1- Linked the authentication with authorization which is supported by a JWT would be a more real-life example 2- Customization of the login page : Definitely, who wants to use it as it is ?! Thanks a lot !!!! 💙

  • @arnaudpoutieu1331
    @arnaudpoutieu1331 Год назад

    Very informative one. Thanks Dan!

  • @S487x
    @S487x Год назад +4

    It would be great to have a tutorial with customized login and error pages and a real FE connection!

  • @Priya-uz7yy
    @Priya-uz7yy 3 месяца назад

    Super cool, always wanted to do it but never knew it was that easy :)

  • @vaibhavsrivastava4645
    @vaibhavsrivastava4645 3 месяца назад

    A very good content to start with. Thanks Dan.

  • @user-nm8zo6zi5f
    @user-nm8zo6zi5f 7 месяцев назад

    Thank you so much, that's really help me 'cause spring security is to difficult for me

  • @DanielHorrisberger
    @DanielHorrisberger Год назад

    Yeah I wish a login customization. Great video Dan!

  • @HerrKaleu777
    @HerrKaleu777 Год назад +1

    Hi Dan! Thanks for your great videos! I am currently trying to set up a Spring Boot 3.05 REST Api which I want to security using a Keycloak server (which in turn ist hooked up to an LDAP server). I seem to get lost between several changes in Keycloak, Spring security and different tutorials. Any chance you could make a blog post on how to facilitate Keycloak in SB Rest API?

  • @nazariitkachuk9274
    @nazariitkachuk9274 Год назад

    Great explanation!!
    Thanks 😊

  • @RossieHoorn
    @RossieHoorn Год назад +4

    Great video. I love it when they are short but powerful!

    • @DanVega
      @DanVega  Год назад +1

      Thank you!

    • @sandeep_begudem
      @sandeep_begudem 8 месяцев назад

      ⁠@@DanVegacould you make tutorial on oauth2 endpoint (no social apps login) so that a user or an entity can access downstream endpoints using the access token? Thank you!

  • @lac4793
    @lac4793 9 месяцев назад

    Hi excellent video, could you please said to me what font you currently use for Intellij?, thanks in advance

  • @romeritoalencardasilva4032
    @romeritoalencardasilva4032 7 месяцев назад

    Tirei o meu o meu chapéu para vc! Parabéns.

  • @akshat1808
    @akshat1808 11 месяцев назад

    Hey Dan, could you please tell me what additional properties I would have to use to implement this for zoom? Thanks.

  • @andyl.5998
    @andyl.5998 Год назад +31

    Definitely would appreciate a tutorial on how to customize the login page with a real front-end framework and tailwind! 🙏

  • @batatafeia362
    @batatafeia362 9 месяцев назад

    Awesome vid!

  • @Jacker3331
    @Jacker3331 10 месяцев назад

    Definately would love to see Spring OAuth in Vue and Tailwind combination!

  • @pawepietrzykowski9893
    @pawepietrzykowski9893 Год назад +7

    Amazing. Tutorial on login with a form mixed with social logins - placed in a separate React or Vue application connected to a spring-boot application acting as authentication and authorization server would be awesome. I could even pay for it :)

  • @ichigoplayss376
    @ichigoplayss376 Год назад

    I feel like I'm using NextAuth/Authjs with this one, thanks a lot Dan, and also hope there is like another tutorial to save those data to our backend. And how the data is stored to the database after a successful Authentication.

  • @Apopjak
    @Apopjak 10 месяцев назад

    What the hell , duude, this is crazy how easy it is thanks for the video

  • @SimpleCookiee
    @SimpleCookiee 3 месяца назад +2

    Good, now we just need to learn how to logout as well

  • @sueprbr
    @sueprbr Месяц назад

    Excellent. Nice and simple.

  • @srinivasaraju8399
    @srinivasaraju8399 3 месяца назад

    This is one of the greatest video please keep make spring boot videos

  • @user-uf3im9ko3g
    @user-uf3im9ko3g 4 месяца назад

    Great tutorial. Is it possible to open the Oauth2 provider login screen in the new popup and close it upon successful authorization?

  • @TheGuroguro12
    @TheGuroguro12 5 месяцев назад +1

    thank you, can same thing be done to custom spring authorization server

  • @kensaitakeso
    @kensaitakeso 7 месяцев назад

    Thanks Dan. it would be great to have the same tutorial for MS Azure as well..

  • @kunalvarpe40
    @kunalvarpe40 Год назад +1

    Yes it would be good know the customizing the pages. Especially with tailwind css.

  • @sagarbhat3884
    @sagarbhat3884 Год назад +34

    Good video Dan! I would definitely be interested in a tutorial for customizing the login screen in a front end app leveraging React or Vue framework, connected to a Springboot application acting as an OAuth client.

  • @punekarinwinnipeg214
    @punekarinwinnipeg214 Год назад

    Hello dan, i had a question related to roles and authority in spring security .
    How can i set authorities directly to the roles. For example : there are two roles ADMIN and ADMIN_TRAINEE. Now only those users with role ADMIN can read and write from/to the database. Whereas users with role ADMIN_TRAINEE can only read from the database.
    Since these roles are enum fields, how can I add authorities to these enum values?
    Should I have a separate private instance variable (String) named authorities and store list of authorities?
    Or is else a way where I can map those enum constants roles to those authorities?

  • @benjaminpeljto7408
    @benjaminpeljto7408 2 месяца назад

    Hello Dan! I have a question regarding the custom UI login page.. Is it okay just to forward the user to the redirect url from backend and let the backend to the rest? Thanks

  • @gordanainic2766
    @gordanainic2766 26 дней назад

    Hi Dan Vega! Thank you for helping us to understand more about Spring! Can you do one video about Spring and WSO2 API Manager? How it works and how do you use it in Spring! Thank you so much!!!

  • @pabloferrando6471
    @pabloferrando6471 Год назад

    How would you achieve that with stateless session management? And could you use OAuthClient to facade and hide the provider login screen?

  • @bloodxxet
    @bloodxxet 6 месяцев назад

    very good tutor, keep it up!! also can u please tell which idea theme u use?

  • @arnaudpoutieu1331
    @arnaudpoutieu1331 7 месяцев назад +1

    Hi Dan. As you asked, please add to this one the customization of login screen (vanilla HTML and CSS). Gratitudes!!!

  • @ademyi
    @ademyi 8 месяцев назад

    great video. thanks

  • @MichaelRinghusGertz
    @MichaelRinghusGertz 2 месяца назад

    Thanks for a great video. Really explaied how to do this in a quick way. But I would love to see a video of using oauth2, but where the application is a API application, with fx a react frontend. But also i would like to store a user from the oauth2 login, such that the user could be coupled to some sort of data.

  • @dan2thi
    @dan2thi Год назад

    Awesome stuff! 💯💯💯

  • @chuongle3353
    @chuongle3353 11 месяцев назад

    What intellij theme are you using on the video? Thanks

  • @joseantoni034
    @joseantoni034 11 месяцев назад

    I would like to watch that tutorial, React, Vue or Angular would be great!

  • @YasithTharindu
    @YasithTharindu Месяц назад

    Wow so simple explanation sir thank u

    • @DanVega
      @DanVega  Месяц назад

      You're most welcome

  • @mlensment
    @mlensment Год назад

    Thank you for the video! I’m really interested how Oauth2 login would work if I have separate front end in VueJs.

  • @ypathan420
    @ypathan420 Год назад

    would definitely appreciate the custom login page tutorial. I have been looking for it everywhere. I can implement custom login page with the normal form login but i am having issues with oauth2 custom login buttons, where should i direct them etc...

  • @ricardoaguilar8508
    @ricardoaguilar8508 Год назад +1

    It would be great to see frontend part in Vuejs and would be great you can teach us how to do it with a spring authorization server

  • @harishbabu1920
    @harishbabu1920 8 месяцев назад

    Hi, this is very intresting.. can you specify how to achieve this by creating our own customized authorization server and client

  • @souravpaul6086
    @souravpaul6086 Год назад

    Great video Dan ❤
    Could you please make a video where we have github login and form login like this video but after successfully login both users (github users and no github users) will get a jwt token to access secured endpoint

  • @AndrulisTravel
    @AndrulisTravel 2 месяца назад

    Any suggestions regarding this stack auth: Spring Boot with Spring Security and for frontend - Nextjs. Nextjs runs on server and it has part of server side and client side components. I need auth with credentials and Google sign in. From my understanding i need to store jwt inside http only cookie. But what are the strategies for frontend to check the jwt exparationand logout the user?

  • @manassehrandriamitsiry5749
    @manassehrandriamitsiry5749 Год назад

    amazing tutorial

  • @user-zs3om7ws9u
    @user-zs3om7ws9u Год назад +2

    Thanks for great video. can u plz make a video with UI framework like React /Angular + Spring security :)

  • @hanisntsolo
    @hanisntsolo 3 месяца назад

    Awesome!

  • @Korgoon
    @Korgoon 8 месяцев назад

    I wonder where from did you got that redirect_url, you don't have endpoint like that in your application but everything is working. Why?

  • @nitisharora2795
    @nitisharora2795 12 дней назад

    short and crisp!

  • @tommy--k
    @tommy--k 4 месяца назад

    Nice! Thanks!

  • @middle4467
    @middle4467 3 месяца назад

    what theme, font you use for your editor sir?

  • @manoharmaddula6700
    @manoharmaddula6700 11 месяцев назад

    Thankyou so much!

  • @AlokKumar-ot9sx
    @AlokKumar-ot9sx 7 месяцев назад

    Hello Dan Thanks for this helpful video. I need a help
    I need to build an app that has two types of users. One is that needs to go through normal authentication via Spring Security and the other set of users can directly access the app without going through any kind of authentication. (We will differentiate users based on their IP Addresses.) Also I am using Spring Security 6.
    How to achieve this. Any help and guidance will be appreciated.

  • @hkkabir2024
    @hkkabir2024 9 месяцев назад

    it's so easy wow!

  • @NguyenPhuc-pt8bh
    @NguyenPhuc-pt8bh 8 месяцев назад +1

    at minute 4:32 what did he click to add on-demand static import

  • @alessandrobx5850
    @alessandrobx5850 Год назад

    Thanks for this video and how to customize the login Page Is very intresting topic

  • @antikerantrieb2382
    @antikerantrieb2382 3 месяца назад

    I Choose Java 21 and have to many problems did something Change since 17 with the 0Auth2??

  • @shaileshsathe9779
    @shaileshsathe9779 8 месяцев назад

    Hi @Dan, It's very informative ,Can you also create any video of Authorisation Server, Resource Server and Client in the same rest API application using Spring Security, Spring Boot 3, Spring Boot Starter Authorization Server using JWT that way I can also save the resources for different server ?

  • @mustafakucuk1338
    @mustafakucuk1338 20 дней назад

    This video is helpfull. Is there a video for social login with angular and spring boot.

  • @TechLearningAcademy
    @TechLearningAcademy 9 месяцев назад

    how it would working for machine to machine login, without user interaction

  •  Год назад

    Great, thank you

  • @AlanHearshel
    @AlanHearshel 7 месяцев назад

    good for an initial insight, but I feel it is kind of incomplete.
    what if I need to execute a Post? I cant do it from the Browser, right? And if I execute via Postman I wont be viewing the pretty login screen. So I would appreciate a follow-up video to this one so we can learn how to authenticate other types of requests.

  • @sadboi3002
    @sadboi3002 6 месяцев назад

    thanks for the video

  • @steakwithmax
    @steakwithmax 3 месяца назад

    great video Dan. can you make a video that user can login with facebook?

  • @akhiladiga9771
    @akhiladiga9771 Год назад +1

    Hello Dan , could you please make a video on Spring Authorization server.

  • @user-lw2jn8gp3e
    @user-lw2jn8gp3e 8 месяцев назад

    good video&Demonstartion, could you please make video about OKTA authentication via springboot application REST Api

  • @DOEPESCISOI
    @DOEPESCISOI 11 месяцев назад

    thanks great video wondering how do implement in my own front tend to put the github link there please help lol

  • @igorpavlenkov3658
    @igorpavlenkov3658 Год назад

    Super!

  • @Bubumuk
    @Bubumuk Год назад +1

    Nice. I'd like to do it with keycloak

  • @user-iq1by8rn2v
    @user-iq1by8rn2v 11 месяцев назад

    thank you soo much

  • @happydev512
    @happydev512 Год назад

    You are the best

  • @artemiybychkov329
    @artemiybychkov329 Год назад

    are these callback urls predefined in oauth2?

  • @gauravtatke
    @gauravtatke 5 месяцев назад

    hey what theme of intellij is that?

  • @fredericoasoares
    @fredericoasoares Год назад

    Great!

  • @NurmukhamedaliBegildayev
    @NurmukhamedaliBegildayev 25 дней назад

    Amazing! Next How to authorize thru it and save this user to Database as customer.

  • @jayeshkhadke5516
    @jayeshkhadke5516 5 месяцев назад

    Hi Dan, can you also show how to do it using Slack in Spring Boot

  • @delsix1222
    @delsix1222 4 месяца назад +1

    I really don't understand what am I doing wrong. I have correct client id and client token, the application successfuly redirects to the github oauth2 login (the link is just like in the video), i'm using latest spring boot version, but github says "404 page not found"
    edit: i fixed the issue (in 5 minutes lmao), my client id was incorrect. i had to be more vigilant

  • @arthurl3265
    @arthurl3265 4 месяца назад

    How it works with nativ apps? Like android oder IOS?

  • @chennakesavulu08
    @chennakesavulu08 9 месяцев назад +2

    Hi Dan,
    Thanks for doing this video. It's amazing video.
    I tried same with spring boot 2.7.14 and jdk 8
    auth.requestMatchers("/").permitAll(); this line getting error that:Cannot resolve method 'requestMatchers(String)'

  • @furkanucar52
    @furkanucar52 Год назад

    Great way to teach sir, but can you make your camera little bit smaller? Can't see easily because of it :(

  • @luizdosreis9610
    @luizdosreis9610 Год назад +1

    Very nice, how this works with an Angular or Vue as Frontend?

    • @jaysizmir9432
      @jaysizmir9432 Год назад

      I believe you just need to use the secured endpoint in his example and set up a custom form login(which can come from Angular, vue or whatever) by providing your login form page url. You can add in the builder of the HttpSecurity object methods like loginPage(), loginProcessingUrl(), failureUrl() and so on...

  • @user-ry2sz2vs6o
    @user-ry2sz2vs6o Месяц назад

    After running my application, no password is provided even though it is required when i try to open localhost:8080

  • @avokadon3103
    @avokadon3103 Год назад +1

    What if you do have a separate frontend app. Like a Angular/React app. How do you do with the formlogin then?

    • @DanVega
      @DanVega  Год назад

      You can't use formLogin from your own client and you would need to provide your own form in your Angular Application. Here is an example of how to do that.
      spring.io/guides/tutorials/spring-security-and-angular-js/

  • @gennadyshevchenko7940
    @gennadyshevchenko7940 Год назад +1

    Can you create video about classloaders?