Implementing login with Facebook and Github from scratch - Java Brains

Поделиться
HTML-код
  • Опубликовано: 5 дек 2019
  • In this tutorial, we'll implement a Spring Security application from scratch and implement a login with Facebook / Github feature using OAuth SSO. You'll understand how OAuth can be used for authentication and some disadvantages of the approach.
    Spring OAuth Guide: spring.io/guides/tutorials/sp...
    Java Brains website: javabrains.io
    #JavaBrains #BrainBytes #HowTo #SpringSecurity #Spring #SpringBoot #JWT #Java #Tutorial

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

  • @Mrsubset
    @Mrsubset 4 года назад +14

    Bravo!!! You're not only a developer, but also a teacher. I just completed your well-detailed spring security series. Thanks

  • @baidyanathpanda1964
    @baidyanathpanda1964 4 года назад +16

    It is always my first suggestion to my friends and colleagues who wants to learn spring hibernate is to watch Javabrains.

  • @theomiddehghan
    @theomiddehghan 4 года назад +15

    I liked the way you explain stuff, makes it so simple!

  • @SagirAnsari-bn7oj
    @SagirAnsari-bn7oj 4 года назад +26

    Awesome .... Your notification make me working day in weekend

  • @ShubhamSingh-ku2ow
    @ShubhamSingh-ku2ow 3 года назад

    kaushik, you are the best. saw the complete series of 3 videos on OAuth 2.0 and I feel pretty confident now on how it works. Please keep making such videos. Proud of you!!

  • @TechnicalGuptaJi200
    @TechnicalGuptaJi200 3 года назад +1

    Everyone has knowledge but this guy has skill to deliver that knowledge so that anyone can easily understand. I am impressed with your teaching skill .Hope for your better scope.

  • @premrajsahu7956
    @premrajsahu7956 4 года назад +3

    Thanks a lot for all these hard work. Waiting for openid connect next in this series

  • @NIKHILKOMMURI
    @NIKHILKOMMURI 2 года назад +1

    I just love the way you teach

  • @anilgadekar848
    @anilgadekar848 4 года назад +2

    It's pretty cool and simple way to authorize clients.. Thanks Khoushik sir 🙂🙏

  • @praveenkumar-ko4sx
    @praveenkumar-ko4sx 2 года назад

    Great series for Spring security 👍 Thank you👍

  • @nandhureddythippareddy9201
    @nandhureddythippareddy9201 4 года назад +49

    Please continue micro services series

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

    Thank you java brains for this series. the concepts were broken down so well making them easy to understand.

  • @nirmalmaheshs
    @nirmalmaheshs 4 года назад +3

    thanks for the video sir, awaited playlist

  • @JAKdeLILLIPUT
    @JAKdeLILLIPUT 4 года назад +6

    You are doing great job, Sir. It would be a great honor if you make a full project using spring boot, microservice, (e.g management system related).

  • @wfuertes
    @wfuertes 2 года назад

    Man, awesome series about auth you have done!!

  • @sakthijeganathan9573
    @sakthijeganathan9573 3 года назад

    Great content and clear explanation on each topic... thanks a lot!

  • @MukeshKumar-vv3wd
    @MukeshKumar-vv3wd 3 года назад +1

    I really like the way you teach, following you since javascript for developer series!
    I just wish you did more python videos, we need more pythonbrains

  • @adfraggs
    @adfraggs 2 года назад +1

    You are very good at this. I hope it is rewarding, and not just in an emotional sense. Keep it up.

  • @vidyasagarpallikonda8818
    @vidyasagarpallikonda8818 3 года назад

    too good, the specially the examples used and explained are very easy to understand

  • @brayanhernandezmora8619
    @brayanhernandezmora8619 4 года назад +1

    Your content is gold thank you sir

  • @OmprakashYadavIIT
    @OmprakashYadavIIT 3 года назад +1

    hang on a sec 😂, I like the way you start this topic.. you are a great teacher 👍

  • @aoyankar3597
    @aoyankar3597 3 года назад

    Thanks a lot sir.I'm searching your face behind your sound.But in this video i'm become so happy after seeing your face.I think genuine concept about Spring security will be complete by following your lectures. Great Job Sir.

  • @madhumitanaskar962
    @madhumitanaskar962 3 года назад

    woh woh woh!!! you are great sir... watched all your videos from spring to spring boot to microservice to spring security.... oH ho!!! you are a great man.. thank you for sharing your great knowledge.. looking forward to learn more from you.. :)

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

    "Let's pick the latest version...it's GOOD ENOUGH" made smile ;)

  • @yfriendspc
    @yfriendspc 3 года назад +1

    Excellent and wonderful teaching style, soothing voice and superior explanation. Keep up your hard work, If possible start series on ONAP.

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

    Thank you so much sir for providing such kind of great content with clear concepts!

  • @Ranjithkumar02
    @Ranjithkumar02 4 года назад +3

    Watch from 7th minute if you know what is oath otherwise don't skip he explained very well what is oath

  • @swarajgupta3087
    @swarajgupta3087 2 года назад

    Such an easy explanation !

  • @indranilgoswami1500
    @indranilgoswami1500 4 года назад

    You are outstanding kaushik...

  • @easwargaming7903
    @easwargaming7903 4 года назад +2

    Simply..... WoW !

  • @bikideka7880
    @bikideka7880 2 года назад

    this is exactly i was looking for. thanks

  • @lakkamsonline7845
    @lakkamsonline7845 3 года назад

    Love you Darling....You are a true legend who has super duper clarity on each topic.

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

    I have went through all the Spring security videos and loved it. Please create new video on the Intermediate and Advanced series for Spring Security.

  • @abhaymishra8112
    @abhaymishra8112 4 года назад +3

    Hi Kaushik !! you are doing a great job, I gone thorough your videos related to Spring Security, and it was ultimate where you made my concept related to Authentication more clear by creating example with .. InMemory, Jdbc..etc. even before you made animation which was quite helpful to understand how AuthenticationManager works with different AuthenticationProvide Implementation.
    Can you create few videos on AuthroizationServer in same way to get understand flow of accesstoken and its implementation, so that we can generate accesstoken/refreshtoken and validate users.

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

    Great content

  • @ahmadshaon7682
    @ahmadshaon7682 4 года назад

    good series, thank you

  • @yagarwals12
    @yagarwals12 4 года назад

    Koushik Sir, It takes a lot to research on and present it this with level of articulation. I have learned a lot from your videos. I was able to switch jobs because of you. Many congratulation and THANK YOU(Pls, Assume this thank you is written in bold and biggest font size ever :P)

  • @marcusscott4024
    @marcusscott4024 3 года назад

    well done kaushik

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

    what a nice video!

  • @lintaozhang8028
    @lintaozhang8028 3 года назад

    Thanks!!! It's really easy to understand and I could follow up to write running code! I hope you can make a video about how to setup an Oauth server

  • @sudipto.m
    @sudipto.m 4 года назад +1

    Koushik tech tips.... 😁

  • @dvt32
    @dvt32 4 года назад +2

    Getting better at speaking in front of the camera, man! Thanks for all the awesome tutorials!

  • @rubalprakash3103
    @rubalprakash3103 4 года назад +10

    Please make a video on websockets because I would rely on no other source than Java Brains :-)

  • @BalaKrishnan-mk6hq
    @BalaKrishnan-mk6hq 4 года назад

    Thanks again!!!

  • @abhishekpatidar9903
    @abhishekpatidar9903 3 года назад

    Thank you so much sir for an amazing series. Please also make videos on Payment gateways with spring boot.

  • @bmalhi3309
    @bmalhi3309 4 года назад +1

    Nice Oauth overview but as you might have noticed OAuth2 is also available for spring security what major differences can you tell there are with OAuth and OAuth2. Why did you go with Oauth instead of OAuth2. Thanks again :)

  • @bestvenkatesh
    @bestvenkatesh 4 года назад +2

    Hi .. this is excellent tutorial!!!!
    Could you pls also create video on the Spring boot app +docker+kubernetes .

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

    Awesome series, I am a better developer now.

  • @MsAbhi1201
    @MsAbhi1201 4 года назад +5

    Could you please add a video on openid connect as spring has deprecated many of oauth classes

  • @mayankgoyal6194
    @mayankgoyal6194 4 года назад

    Thank you Koushik

  • @MegaMohit92
    @MegaMohit92 4 года назад

    A very nice explanation.
    Recently I got a chance to visit Germany for Working purpose, I was happy as well as surprised to see that many people in Germany follow your tutorial.
    But I was really sad to hear that, they are not able to pronounce your name correctly!!!!!!!

  • @deepashrihk2120
    @deepashrihk2120 4 года назад +1

    Hi Kaushik, Could you please include the best way to initialize the DB parameters and DB pooling in Springboot?

  • @moebenali427
    @moebenali427 3 года назад

    Thank you!

  • @TheDheerendraJaiswal
    @TheDheerendraJaiswal 3 года назад +5

    I always ask my friends to go to javabrains on youtube to learn spring security. I am sure you would agree with me sir that this series is incomplete without custom auth server and resource server tutorials. I watched various videos but nobody explains the way you do, Sir. I have been waiting for that for so long. Plz make videos on custom resource owner password grant flow, custom authorization code grant flow and custom client credentials grant flow.

    • @abhishektomar7036
      @abhishektomar7036 3 года назад

      I agree with you and am myself waiting for the videos on custom authorization server, resource server and OAuth implementation

  • @hhmondol
    @hhmondol 3 года назад

    Hi Kaushik, your tutorial series is just great. I have learnt a lot from your videos. Now I'm asking for a bit more. I don't know if its possible but looking for something where a think client java application ( swing, fx , or Eclipse RCP) can be integrated with google authentication. It's like a valid google user can login to an application installed on a PC ( Non Browser ...no Html/javascript) . I know it may sound a bit outdated but if you could provide me with some help . thanks

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

    This is a great video.. I got a clear idea about OAuth. I have a request please make a spring boot authentication with Microsoft Entra ID with Azure API Gateway Management.

  • @foruvasanth
    @foruvasanth 4 года назад

    come on Javabrains load them all..... Neo in making here

  • @harrisonjunior8987
    @harrisonjunior8987 3 года назад

    Hello Koushik! I love your classes, could you make a video about oauth2, implementing a resource and authorization server with spring?

  • @heyitsaakash
    @heyitsaakash 2 года назад +1

    how will we map custom roles/permissions that spring app would require after authentication e.g to allow certain features only to specific type of users

  • @llf9987
    @llf9987 2 года назад +1

    Thank you Kaushik .. it seems @EnableOAuth2Sso is deprecated, could you please update this tutorial accordingly.. thanks in advance.

  • @garry2cool
    @garry2cool 4 года назад

    Nice explanation.. please upload SAML authentication also

  • @sahilgogna3393
    @sahilgogna3393 3 года назад

    Thank You :)

  • @mdsiddiq4145
    @mdsiddiq4145 4 года назад

    Waiting for next videos kaushik.

  • @sanketchakraborty1121
    @sanketchakraborty1121 3 года назад

    Thank you for the tutorials. Great analysis.
    Could you please share the github repo for this ?

  • @sahinsarkar7293
    @sahinsarkar7293 4 года назад

    How exactly to handle clientSecret? Should we put it in a db instead of a properties file? Or are there more secure ways to store them?

  • @anilreddy5009
    @anilreddy5009 4 года назад +1

    Hi kaushik,
    U didn't tell how to create a GitHub app and I m little confused with the same. Could you please help me

  • @aabidbinfarooqibniali2817
    @aabidbinfarooqibniali2817 Год назад +2

    Great Content Sir.
    I am however getting an error when i try to use @EnableOAuth2Sso with SecurityFilterChain instead of WebSecurityConfigurerAdapter (since this is deprecated) as the annotation is somehow invoking webSecurityConfigurerAdapter. the error is get is
    "Found WebSecurityConfigurerAdapter as well as SecurityFilterChain. Please select just one."
    Can you please suggest a workaround for it?
    TIA
    Regards
    Aabid

  • @TheAmit4sun
    @TheAmit4sun 4 года назад

    I was more curious to see how you persist the token for micro service inter communication. Who maintains the timeout, do client/micro service probe to authentication service for validity of the token when the intercommunication between the micro service happens.

  • @Pluto102
    @Pluto102 4 года назад

    wat if want to provide options for Both FB and GITHUB authentication and my own implementation too i.e . basic authentication

  • @adarshverma3372
    @adarshverma3372 3 года назад +1

    Please help
    what if in my application let's say I am implementing the oauth using google for SIGN UP and when the user gets signup using the google auth and then the google auth will only give me the email id of the user then how I am going to implement the Authorization in my application like role based giving access to different users according to their roles.

  • @DT-oo5mp
    @DT-oo5mp 4 года назад

    Hi Koushik. I connect to the Internet through a proxy. In that case, should I make any changes to "application.yml"?

  • @seshagirinitr123
    @seshagirinitr123 2 года назад

    Thanks for the class, very informative, i have one query, where i can i find the code for this implementation. i am not clear what all the details client needs to store for subsequent request and where will one get that from in code. how to manage multi user use case.

  • @uttamshaw7817
    @uttamshaw7817 3 года назад +2

    @JavaBrains: Thank you for the nice tutorial. I have successfully implemented with the facebook authorization. I have also implemented with the github and authorization screen comes up but after that error happens.
    After removing the propery "authenticationScheme: query". everything works fine.. :)

  • @akkyp5920
    @akkyp5920 4 года назад

    Hi Kaushik, please add more tutorials for authentication in micro services using open id connect

  • @markussuzuki3051
    @markussuzuki3051 3 года назад

    Hi there, nice tutorial!!!
    Question, how do I make a call from the Postman Application? Use the Basic Authentication with username and password?
    Do I get a token back? if yes, how do I use that token with Postman?
    thx, Markus.

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

    Hi Sir
    Suppose we configure both Google and Facebook in the properties file if we hit localhost:8080 which page will be shown Google or Facebook page?

  • @himanshuchugh4257
    @himanshuchugh4257 4 года назад

    how can i make a button that says "login with google" "login with fb" and after that button's click i go to the login page of face book where it says "continue as kaushik", please help with this

  • @skullwise
    @skullwise 4 года назад

    Love from Canada #Kaushikno1fan

  • @TheCodingRaconteur
    @TheCodingRaconteur 4 года назад +7

    It appears that the maven dependency is deprecated (at least the annotation for SSO)

    • @amritnalam9994
      @amritnalam9994 3 года назад

      What to do then?

    • @apt621
      @apt621 3 года назад +2

      @@amritnalam9994 github.com/sreddyiitr/spring-oauth2-authentication. I followed spring.io/guides/tutorials/spring-boot-oauth2 to write it

    • @Braklord
      @Braklord 3 года назад

      Because of deprecated spring-boot-security, there is a new spring-security (5.0+) version. But no idea, how to implement it there. If someone has an idea, please contact me.

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

    Great video! I have a question: does every person using this application has to beforehand go into their facebook account and allow this application? How can this be used by customers of the product?

  • @thohuynh437
    @thohuynh437 4 года назад

    OAuth itself is used for authorization. If Oauth is used for authentication like this, is it equivalent to SSO?

  • @dhoniramakrishna120
    @dhoniramakrishna120 4 года назад

    thank u

  • @sonaliraina11
    @sonaliraina11 3 года назад

    What about the situation if I don't have a UI and the user still wants to access resource server info. How to get the authorization then as without user interaction. User wont be able to enter his credentials in redirected url?

  • @areyoukidding6274
    @areyoukidding6274 3 года назад

    I am confused now,
    Q1: is API call to Google drive is happening from browser or happening from Server(backend) hosting the Photo print Service application?
    Q2: Suppose if the call happening from backend how does the user will select which picture he want to choose from google drive?
    Someone pls help me answer this

  • @sovannborithyun5205
    @sovannborithyun5205 4 года назад

    How to authorize by using this approach like role base authorization?

  • @anurag9110
    @anurag9110 4 года назад +3

    I tried using spring-security-oauth2-autoconfigure version 2.2.4 dependency. @EnableOAuth2Sso is deprecated. Or is it compulsory to use v2.1.8?

    • @utkarshgupta8061
      @utkarshgupta8061 4 года назад +1

      Same issue here and also getting "Missing tokenInfoUri and userInfoUri and there is no JWT verifier key" while starting up the application. Did you make some changes to the application.yml file?

    • @oleglitovka2286
      @oleglitovka2286 3 года назад

      @@utkarshgupta8061 I have the same problem. Did you find by any chance a solution?

    • @utkarshgupta8061
      @utkarshgupta8061 3 года назад

      @@oleglitovka2286 Nope, I didn't.

    • @Braklord
      @Braklord 3 года назад

      ​@@utkarshgupta8061 Because of deprecated spring-boot-security, there is a new spring-security (5.0+) version. But no idea, how to implement it there. If someone has an idea, please contact me.

  • @jeganmuthu6962
    @jeganmuthu6962 4 года назад

    If the user doesn't ve account in Facebook or Github, what type of error it will shows...?

  • @abhaymishra8112
    @abhaymishra8112 4 года назад

    Heyy Kaushik !! one more request, if possible can you create series on SpringTransaction. I didn't find any well explained tuto video on youtube related to SpringTransaction.

  • @shitalbelokar9499
    @shitalbelokar9499 3 года назад

    Hi Koushik I have tried oauth2 Facebook example and followed all the steps as u mentioned in this video but still I am getting org.springframework.security.client.resource.UserRedirectedRequiredException:ARedirect id required to get the user approval
    So could u please help me with that

  • @GauravSharma-sj9yx
    @GauravSharma-sj9yx 4 года назад

    Hi Sir, could you help me with implement login with Okta feature using OAuth SSO in my Non-Boot web application? I will share my sample project code with you wherein I am trying to integrate using online articles

  • @mritunjayyadav3788
    @mritunjayyadav3788 4 года назад

    great video , but how to integrate this functionality with angular ?

  • @santasachin
    @santasachin 3 года назад +1

    Hi, let's say I have own jwt authentication login system already and I want to add this login with Facebook as well. How can I do that

  • @DipendraBhatta-sr2vj
    @DipendraBhatta-sr2vj 2 месяца назад

    Can you explain the process of saving an OAuth2 user along with a normal user in a database?

  • @sanketh768
    @sanketh768 2 года назад

    Can we have both Google and Facebook authentication and then the user can choose which one to authenticate with?

  • @MrRolbas
    @MrRolbas 3 года назад

    Please make tutorial how to set up few logging providers in one app (for example google and facebook). And if possibly how to bind it with custom user database in REST environment.

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

    Man... I am preparing for a senior interview and this is just part I am trying to cover.... Because your way of teaching twist in the climax of videos...ending up continue watching...lol...

  • @elakkiyam315
    @elakkiyam315 4 года назад

    First time i created and the application worked as expected but next getting the following error. Can someone help me on this.
    Further my html page is not getting hooked up.
    UserInfoTokenServices : Could not fetch user details: class org.springframework.web.client.HttpClientErrorException$NotFound, 404 Not Found: [{"error":{"message":"(#803) Some of the aliases you requested do not exist: mem","type":"OAuthException","code":803,"fbtrace_id":"AZ6NSc-_Q_1jOir87Z4nUFh"}}]

  • @hyperborean72
    @hyperborean72 3 года назад

    if one goes to tutorial at Spring.io, he will find that the yaml looks like:
    spring:
    security:
    oauth2:
    client:
    registration:
    github:
    so it has two more lines not present in Koushik's tutorial:
    registration:
    github:
    I wonder if we have to constantly check if the Spring configuration has changed, otherwise our app will get broken

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

    When I tried logging in using the Facebook OAuth for the first time, I experienced error: "Something went wrong" on FB side and when I click back, it prompted to Hello User page. :D
    I think this should be fine?

  • @interstellar1896
    @interstellar1896 4 года назад +1

    big problem is .......how connect microservice oauth2-jwt with Angular ...??...!!!.....is i need to setup Client Id & Pass,Username&Pass in Angular app OR setup OAuth SSO in zuul....!!!

    • @Java.Brains
      @Java.Brains  4 года назад +1

      I recommend checking out the link in the description for Spring OAuth guides. It does a detailed job explaining these scenarios, and I don't plan to cover videos for all of them.