Single Sign-On with Spring Boot & Okta | OAuth 2.0 | Java Techie

Поділитися
Вставка
  • Опубліковано 16 жов 2024
  • This video explain you How to Add Single Sign-On to Your Spring Boot Web Application using okta & OAuth 2.0
    #javatechie #SpringBoot #Security #Okta_SSO #OAuth 2.0
    GitHub:
    github.com/Jav...
    Blogs:
    javagyanmantra...
    Facebook:
    / 919464521471923
    Music: City_of_Jewels
    guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
    Disclaimer/Policy:
    --------------------------------
    Note : All uploaded content in this channel is mine and its not copied from any community , you are free to use source code from above mentioned GitHub account

КОМЕНТАРІ • 139

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

    Hi Basant sir, in this implantation what method of SSO is basically used, is it SAML? or OpenIDConnect? how do we know?
    have you had more detailed video on this topic?

  • @nikhilgupta9685
    @nikhilgupta9685 3 роки тому +5

    Thanks for the video. Just an update, as of to-date, the application type needs to be selected as OAuth Service to get Client ID & Secret. Selecting type as Web with SWA or SAML or OpenID wouldn't give you client ID/Secret.

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

    Thanks Basant for great knowledge.
    SSO basically works for different applications access without asking login so in this video multiple applications are not there, and you have created only one application and triggered the same endpoint multiple times, bit confusing...

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

      The moral here is to delegate the auth request to a 3rd party provider so for demo purposes I have created a single app but you can create multiple apps and test it.

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

      @@Javatechie so we need to add new app in okta, okay I'll try

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

    But the requirement can be opposite.Why would you login the user to youtube? It should happen only when I click on login button on UA-cam.I logged into gmail because i want to check my email but i don't want to login to youtube or map?

  • @ranjandas7891
    @ranjandas7891 5 років тому +5

    Super Sir...Sir please upload small spring boot project with all implementation likw spring security,thymeleaf,etc

  • @ajaydhiman2368
    @ajaydhiman2368 3 роки тому

    My query - here you are using Okta server for authentication but in real time project where there is no Okta OR any other system then do we need to build it own first before implementing SSO ? I mean what happens in real time project basically. Which items/components will be provided by client OR what we should ask from client. can you please put some light on these basic queries.

  • @rexsam3134
    @rexsam3134 4 роки тому

    Latest version of Spring Boot is 2.4.1 and video is on 2.1.4.
    Any reason why it doesnt work on latest version of Boot and Okta?
    Your video is just 1 year old.
    Okta url for new app too has changed

  • @AnkitLadha-fo8em
    @AnkitLadha-fo8em 4 місяці тому +1

    Okta dependency is not available in spring boot 3.3.0. What’s the alternative

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

      Not sure will check and update you

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

    The values you have stated in application.property file about okta server ....where have they been used in application ?

    • @ye-1723
      @ye-1723 Місяць тому +1

      those are for configuration only and won't be used explicitly in your code, they're managed automatically by spring boot and okta dependency, for example you tell tomcat to use 9090 as the server port

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

    Great post. I was looking for a simple application and I got it ❤

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

    How it will work for multiple user logins with different username and password

  • @shabri1980
    @shabri1980 3 роки тому +1

    Nice Explanation.
    My requirement is below
    1. Enable okta MFA for certain users.
    2. Can we switch to okta MFA conditionally based on a flag check from Principal
    3. If we dont have spring boot but just spring how can this be done.
    Thank you

    • @Javatechie
      @Javatechie  3 роки тому +1

      MFA I am not aware about this let me check

    • @shabri1980
      @shabri1980 3 роки тому

      @@Javatechie Thank you awaiting your reply.

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

    Thank you so much for this valuable tutorial..you are awesome 👏👏👏

  • @sssd5632
    @sssd5632 3 роки тому

    I am getting SSLHandshakeException, PKIX path building failed while running the program, please help

  • @amitkumar7566
    @amitkumar7566 3 роки тому +1

    It's not working and throwing error.. I am using springboot 2.3.8 and okta 0.6.0...can you make an updated tutorial on it...or just help with the new updated

    • @Javatechie
      @Javatechie  3 роки тому

      Amit check in okta official side , you can raise an incident their for version conflict

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

    Hi Sir , Can you please show or reply to me how to generate this token when third party is accessing my api , how they will pass user and password information in the header or how they will pass this token

  • @pujasingh561
    @pujasingh561 2 роки тому +1

    while creating okta account its asked me the business mail only So I created with my company mail id ,now I have fear like will it charge money after 30 days, please help me on this and if it will charge how to delete account

    • @Javatechie
      @Javatechie  2 роки тому

      No they won't charge don't worry . And it's not good practice to create trial account with company mail id

    • @pujasingh561
      @pujasingh561 2 роки тому

      @@Javatechie but its not accepting my personal mail id

  • @abhishekpatidar9903
    @abhishekpatidar9903 3 роки тому +1

    i have three microservices and for front ent i have angular application, then i want to login with my own database by using jwt, then how i can use single sign own feature, that is when user gets once logged in then it can access all the three microservices api by using that jwt token.

    • @Javatechie
      @Javatechie  3 роки тому

      Then why you are expecting SSO here ?

    • @abhishekpatidar9903
      @abhishekpatidar9903 3 роки тому +1

      @@Javatechie then i need to authenticate for every microservices or is there any way, please suggest?

    • @Javatechie
      @Javatechie  3 роки тому

      Yes each request need to authenticate

    • @Javatechie
      @Javatechie  3 роки тому

      If you want to exclude any path then specify antMatchers

  • @gattupalli690
    @gattupalli690 3 роки тому +1

    Sir I am getting this error org.springframework.security.oauth2.client.resource.UserRedirectRequiredException: A redirect is required to get the users approval can you help me?

    • @Javatechie
      @Javatechie  3 роки тому

      Sowmya can you import my code and only change your secret key info

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

    Really love the range of topics you cover. May i request you for a video using SpringSecurity with SAML2 and PingFederate. The call shall originate from ReactJs app and ilredirected to pingFederate via Spring Security. I need to use Java 8

  • @AjitSwain-q3o
    @AjitSwain-q3o Місяць тому +1

    Can ther be latest video on okta after spring boot 3.xx

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

      I haven't tried it in recent time

  • @diegoramos27
    @diegoramos27 2 роки тому

    Hi sir I don't have the "Cloud OAuth2" starter, how can I find it ? Thanks

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

    i cant able to login to okta console through rest end point showing unable to sign in ,please reply

  • @sameertiwari1562
    @sameertiwari1562 4 роки тому +1

    Thank you Sir for explaining this
    how we can integrate active directory in okta

    • @Javatechie
      @Javatechie  4 роки тому

      Didn't get you active directory ?

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

    Great explnation sir. Can you please let me know sir how to test this in postman

  • @MustafaKhan-gs2fy
    @MustafaKhan-gs2fy 4 роки тому +1

    On implementing this getting below exception
    org.springframework.security.oauth2.client.resource.UserRedirectRequiredException
    Can you please let me know what I am missing?

    • @shehzab786
      @shehzab786 4 роки тому

      any solution for this?

  • @anandathakur4937
    @anandathakur4937 4 роки тому

    How to get the access token here.. If I have more API and I want to test them from postman how can I get the access token.

  • @kayeshparvez
    @kayeshparvez 3 роки тому +1

    Thanks for the nice demonstration. What should I do if I want to remove the dependency of okta and the whole SSO to be controlled by my own app ?

    • @Javatechie
      @Javatechie  3 роки тому +1

      You can go for spring saml api

  • @subhajitdey868
    @subhajitdey868 4 роки тому +1

    Hi, I tried to follow all the steps as shown in the tutorial. However, in my case I'm getting multiple redirect error when I try get to localhost:9090 page...can you please help?

    • @Javatechie
      @Javatechie  4 роки тому

      Did you configure localhost:9090 as redirect URL while configure in okta

    • @subhajitdey868
      @subhajitdey868 4 роки тому

      @@Javatechie I configured localhost:9090/login as redirect URI in OKTA

    • @Javatechie
      @Javatechie  4 роки тому

      @@subhajitdey868 can you share error message with screenshot to javatechie4u@gmail.com

    • @subhajitdey868
      @subhajitdey868 4 роки тому +1

      @@Javatechie solved the issue, it was with application.properties file...it should be clientid not client-id and clientsecret not client-secret

    • @roxyhossen634
      @roxyhossen634 3 роки тому

      @@Javatechie yes i did but i got same error ........ can you help?

  • @vamshir1943
    @vamshir1943 3 роки тому

    Can you show me how to done sso for j2ee applications (servlets ans jsp ) with okta saml authentication.....

  • @MOHITSHARMA-qr7mt
    @MOHITSHARMA-qr7mt 5 років тому +1

    Hi @javatechie, I am getting this issue "org.springframework.security.oauth2.client.resource.UserRedirectRequiredException: A redirect is required to get the users approval", I have clear the cookies and cache but the issue still persist. Please help me on this.

    • @Javatechie
      @Javatechie  5 років тому

      Please verify your secret key once

    • @dpraveenk38
      @dpraveenk38 5 років тому

      I'm facing the same issue. I have a feeling it might be due to versioning problems. I'm using Java 11

    • @thangletrong970
      @thangletrong970 4 роки тому +1

      Hi #MOHIT SHARMA
      You try download source of Java Techie "github.com/Java-Techie-jt/spring-boot-okta-sso" and replace "okta.oauth2.issuer" , "okta.oauth2.clientId" , "clientSecret" for you on okta, and run try again.I have tested and succeeded!
      good luck for you!

    • @samirnai9321
      @samirnai9321 4 роки тому +1

      Worked for me after replacing okta.oauth2.client-id to okta.oauth2.clientId
      and okta.oauth2.client-secret to okta.oauth2.clientSecret

  • @prithvikrishna1164
    @prithvikrishna1164 4 роки тому +2

    Good video sir @javatechie do you have video for several user login in for application

    • @Javatechie
      @Javatechie  4 роки тому +1

      I tried for single user

    • @prithvikrishna1164
      @prithvikrishna1164 4 роки тому +1

      @@Javatechie can you suggest any idea for several user or any referrence

    • @Javatechie
      @Javatechie  4 роки тому

      You can checkout in okta documentation it self

  • @raghalapurushotham3458
    @raghalapurushotham3458 4 роки тому

    Hi Sir, Do we have a provision to disable or enable SSO?

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

    Please make a video on Spring Security with SAML SSO example.

  • @VivekKumar-pp6cc
    @VivekKumar-pp6cc 3 роки тому

    Sir please explain about saml sp initated sso and use pure saml only without third party api i am facing issue in that

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

    awesome content bro

  • @VivekKumar-pp6cc
    @VivekKumar-pp6cc 3 роки тому +1

    Sir can you please explain saml implemention without using okta

  • @siyedyoussef3202
    @siyedyoussef3202 5 років тому +2

    Great video Sir 👍 we would love to see Spring+keyclock

  • @vihareddymandala
    @vihareddymandala 4 роки тому

    DO we have different client-Id and client-secret for each Okta user?

    • @Javatechie
      @Javatechie  4 роки тому

      Yes

    • @vihareddymandala
      @vihareddymandala 4 роки тому

      @@Javatechie In that case do we need to add all those values in the spring property file? How to manage them?

  • @farukmomin-u1l
    @farukmomin-u1l Рік тому

    Can i do it with Ping Id insted of Okta?

  • @taufiquealam1614
    @taufiquealam1614 5 років тому +1

    Thanks bro...Simple way of explanation.

  • @syncmaster793vbe
    @syncmaster793vbe 5 років тому +1

    Awesome video sr keep posting excellent videos likes this one

  • @hemanthgarlapati2640
    @hemanthgarlapati2640 5 років тому +1

    What if other users want to sign in to our application, how to configure it for multiple user login???

    • @Javatechie
      @Javatechie  5 років тому +1

      There is a option in okta console to create a group and we can assign user who can access your application .

  • @fdlessard
    @fdlessard 4 роки тому +1

    Stoped working for okta-spring-boot-starter > 0.6.1

    • @पापानटोले
      @पापानटोले 4 роки тому

      true.
      i am getting below error-
      Description: The 'redirect_uri' parameter must be an absolute URI that is whitelisted in the client app settings.

  • @hamdamboyurunov6034
    @hamdamboyurunov6034 4 роки тому +1

    You are my friend. Woow nice approach

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 4 роки тому +1

    I'm waiting for this video

  • @thahermohammed-s2g
    @thahermohammed-s2g Рік тому

    how to do this with azure sso

  • @raghalapurushotham3458
    @raghalapurushotham3458 4 роки тому +1

    Nice Explanation

  • @praveenkumar-rx9sc
    @praveenkumar-rx9sc 3 роки тому

    Great video but I got bad credentials can please help thanks

  • @kumudhaglory2680
    @kumudhaglory2680 3 роки тому

    Can you please implement oauth2 grant types in spring cloud api gateway

  • @ranjanasamaranayake1006
    @ranjanasamaranayake1006 3 роки тому +1

    Good one.

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

    Okta is 30 days evaluation and now needs company credentials with lot of approval emails

  • @abhijitprusty
    @abhijitprusty 4 роки тому +1

    superb

  • @kumarmanish9046
    @kumarmanish9046 4 роки тому +1

    You are just typing but not explaining. Example, what is the use of the annotation @EnableOAuth2Sso ?

    • @Javatechie
      @Javatechie  4 роки тому +1

      Simply this annotation will enable oauth specific default config in code . That's the reason when you kick start your application it directly redirect to SSO login page .

    • @kumarmanish9046
      @kumarmanish9046 4 роки тому

      @@Javatechie Thank you. And what is the use of http.csrf.disable() ?

    • @Javatechie
      @Javatechie  4 роки тому

      @@kumarmanish9046 please go through below tutorial to understand why csrf with realtime example www.javainuse.com/spring/boot_security_csrf#:~:text=But%20till%20now%20in%20all,which%20they%20are%20currently%20authenticated.

    • @kumarmanish9046
      @kumarmanish9046 4 роки тому

      @@Javatechie Thanks for replying! I understand the CSRF concepts but for this tutorial specifically, what is the use of disabling csrf?

    • @Javatechie
      @Javatechie  4 роки тому

      @@kumarmanish9046 usually we disable it in real-time to avoid malicious attack
      Eventhough it is one Hello world application 🙂

  • @br4676
    @br4676 5 років тому +1

    great sir

  • @gibranmohammadkhan6216
    @gibranmohammadkhan6216 4 роки тому +1

    How to logout??

    • @Javatechie
      @Javatechie  4 роки тому

      You can create a config class extends it from WebSecurityConfigureAdapter then specify your logout URL .
      Also you can check in okta config there should have some option to configure logout URL

    • @gibranmohammadkhan6216
      @gibranmohammadkhan6216 4 роки тому +1

      @@Javatechie I have followed the same steps and I am getting
      "org.springframework.security.oauth2.client.resource.UserRedirectRequiredException"A redirect is required to get the users approval"

    • @Javatechie
      @Javatechie  4 роки тому

      Check is there any firewall restriction on your machine if yes please disable it

  • @hemanthgarlapati2640
    @hemanthgarlapati2640 5 років тому +1

    Expecting spring+keycloak SSO

    • @Javatechie
      @Javatechie  5 років тому +1

      I need to check hemanth , definitely will update

  • @casimirrex
    @casimirrex 4 роки тому +1

    okta.oauth2.clientId
    okta.oauth2.clientSecret ,need to change like this. it will work

    • @Javatechie
      @Javatechie  4 роки тому

      It may be due to the New version 😌

  • @abhishek7969
    @abhishek7969 3 роки тому +1

    want to call this endpoint through postman.

    • @Javatechie
      @Javatechie  3 роки тому

      Not sure about this need to check

  • @arunbandari8936
    @arunbandari8936 4 роки тому +1

    How to logout sir...

    • @Javatechie
      @Javatechie  4 роки тому +1

      Using code you are asking ?
      Once you stop your server automatically you will logged out from okta server .

    • @arunbandari8936
      @arunbandari8936 4 роки тому

      @@Javatechie thanq for reply...

    • @arunbandari8936
      @arunbandari8936 4 роки тому

      Yes using code

    • @Javatechie
      @Javatechie  4 роки тому

      @@arunbandari8936 let me check

    • @prakharsingh3917
      @prakharsingh3917 4 роки тому

      @@Javatechie how to logout using code