Spring Security using OAuth2 in Spring Boot | Tech Primers

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2024
  • This video covers the Spring Security with OAuth2 in Spring Boot
    🔗GitHub Code Link: github.com/Tec...
    📌 Related Playlist
    ================
    🔗Spring Boot Primer - • Spring Boot Primer
    🔗Spring Cloud Primer - • Spring Cloud Primer
    🔗Spring Microservices Primer - • Spring Microservices P...
    🔗Spring JPA Primer - • Spring JPA Primer
    🔗Java 8 Streams - • Java 8 Streams
    🔗Spring Security Primer - • Spring Security Primer
    🔗Containers Primer - • Containers Primer
    🔗Kubernetes Primer - • Kubernetes Primer
    🔗AWS Primer - • AWS Primer
    💥Join TechPrimers Slack Community: bit.ly/JoinTec...
    💥Telegram: t.me/TechPrimers
    💥TechPrimer HindSight (Blog): / techprimers
    💥Website: techprimers.com
    💥Slack Community: techprimers.sl...
    💥Twitter: / techprimers
    💥Facebook: TechPrimers
    💥GitHub: github.com/Tec... or techprimers.gi...
    🎬Video Editing: iMovie
    🎼Background Music: Broke For Free - Day Bird
    brokeforfree.b...
    The Passion HiFi - What We Came To Do
    Joakim Karud
    ---------------------------------------------------------------
    🔥 Disclaimer/Policy:
    The content/views/opinions posted here are solely mine and the code samples created by me are open sourced.
    You are free to use the code samples in Github after forking and you can modify it for your own use.
    All the videos posted here are copyrighted. You cannot re-distribute videos on this channel in other channels or platforms.
    #SpringSecurity #OAuth2 #TechPrimers

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

  • @tvrajesh82
    @tvrajesh82 7 ปีที่แล้ว +6

    It would have been great if you had provided a detailed explanation on why some methods are overridden from Spring and the use of it with different options. However, this video is a great starting point to analyze further ourselves.

    • @TechPrimers
      @TechPrimers  7 ปีที่แล้ว

      thanks. I had done that in my other video on Spring security authentication using DB. hence didnot want to repeat stuff

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

    Great content; the best, simplified explanation of oAuth2 with Spring Boot I've come across. Keep up the good work!

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

    Nice informative video. I liked the way it is explained and coded simultaneously. One thing is i observed is, some of the configurations used are deprecated in the latest spring boot 2.X or later. Users need to note that the example demonstrated is in SpringBoot 1.5.6, which should have been the latest one at that moment :)

  • @michaelwijayagames
    @michaelwijayagames 5 ปีที่แล้ว +10

    A pretty superb tutorial from tech primers..
    Hope this could be helpful for some people..
    Something to mention:
    For auth-server has some deprecated function for version 2 :
    application property should be :
    server.port=8081
    server.servlet.context-path=/auth
    and there is a need to make CustomSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter
    to create bean function
    @Bean(name = BeanIds.AUTHENTICATION_MANAGER)
    @Override
    public AuthenticationManager authenticationManagerBean() throws Exception {
    return super.authenticationManagerBean();
    }
    because @Autowired authenticationManager is not being supported for th Spring version 2
    while security.basic.enable=false already deprecated so we need to change things to disable http basic security by not using spring-security-starter..
    For the client server:
    We need to change deprecated extends WebMvcConfigurerAdapter to just implement the WebMvcConfigurer
    Need to change application.yml configuration into:
    server:
    port: 8084
    #for running behind proxy purpose
    use-forward-headers: true
    servlet:
    context-path: /ui
    session:
    cookie:
    path: UISESSION
    Adios and amigos.

    • @mohammedkamruddin264
      @mohammedkamruddin264 5 ปีที่แล้ว

      please share client , server code details

    • @mustufakhan7084
      @mustufakhan7084 5 ปีที่แล้ว

      I m still getting that authentication manager bean error can you please explain how to solve ot

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

    Nice video, good explanation, I have a question, can I implement OAuth2 authorization with code flow to call an API from another API?

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

    hi , i want to know , do we need to use oauth2 if we want to login in our application through FB or other application credentials , or if we create our application where user needs to register and with those credential only need to login then alos we can use oauth2. Or just using jwt token we can achieve this without oauth2.Looking for your input

  • @viveksingh-rt4py
    @viveksingh-rt4py 3 ปีที่แล้ว +1

    Hi Ajay,
    Excellent explanation. Very well done.
    May I ask one question. We can restrict API access inside a resource server based on Role. In your video you have mentioned that Auth Service can be from google and resource server can be on local machine. If validation happens at Google then how role will be assigned. Google role may not be relevant for our local resource server .
    Thanks,
    Vivek

  • @sainathmachunur4138
    @sainathmachunur4138 5 ปีที่แล้ว

    Nice video bro..i have one doubt,you explained about Authorizing secure URL etc..and where is the concept of access token and authorization code and where we are generating those.Can you tell how to test this in POSTMAN without that client project?

  • @chinmayabehera513
    @chinmayabehera513 5 ปีที่แล้ว

    Awesome Video. I want call third party api using java code,which has implemented oAuth2.0 to secure the APIs.
    1st I got the access_token from that Service.
    Secondly, I want to send a POST request to one api, by sending stringXML and access_token. So, which method of RestTemple should I use??? If there is any best approach please let me know.

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

    Thank you for providing this

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

    Nice Explanation Sir.....

  • @pavankumar-zi5le
    @pavankumar-zi5le 4 ปีที่แล้ว

    how to implement authorization in swagger can you prepare that video please

  • @yogeshchaudhari9971
    @yogeshchaudhari9971 5 ปีที่แล้ว

    hi techprimers... thanks a ton for this video....i didn't get one thing...why it worked after adding the /principal and why it didn't work prior to that....

  • @athulr2215
    @athulr2215 5 ปีที่แล้ว

    Hi. Nice explanation. I have one question for you. I have my authorization server set up and running. I want to build open Id connect upon it. Can't we build a custom provider ourself without relying another party? Is there any good reference or sample available?

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

    Very good tutorial..thank you so much. Could you please explain why was the oAuth extra dependency required?

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

    It's very nice video thanks lot, can you please post video with JWT and with out form authentication of oauth2

  • @RajKumar-wf8nm
    @RajKumar-wf8nm 4 ปีที่แล้ว +1

    Thanks Buddy for sharing your experience and knowledge...

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

    Hi. Awesome video. But I am getting error while click on 'Login to OAuth here'. The error is

    Full authentication is required to access this resource

    unauthorized
    Please help.

    • @ioansteopoaie
      @ioansteopoaie 5 ปีที่แล้ว

      same issue here. Can anyone help please?

    • @ivaspasovska1
      @ivaspasovska1 5 ปีที่แล้ว

      I have the same issue as well, any help?

    • @sumitprakash5637
      @sumitprakash5637 5 ปีที่แล้ว

      Same problem, the login page doesn't display. It is something to do with spring boot 2

  • @MarcoLopez-gg6dl
    @MarcoLopez-gg6dl 6 ปีที่แล้ว +5

    Thanks for the tutorial.
    How can I perform this authentication to protect my REST API and test it from the POSTMAN?
    How could I customize the login.html with css?
    The ClientId, Secret, those come from somewhere or do I define them?

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

    Thank you So much !!
    is it the smae for client credentials grant type aswell ?

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

    just wanted to understand if the Oauth authorization along with authentication that you have shown in your code - is it covering OIDC flow as well?

  • @javaframeworks6677
    @javaframeworks6677 6 ปีที่แล้ว

    Resource server application is having protected resources which can be accessed only through access token and that token has to be issued through separate application that is authorization server.

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

    Hi .. Thank you very much for this video ... this is very enlightning .... btw can you also show how to use this oAuth server using Postman (or any rest client) instead of a client app ... I am trying to do it but not able to see any responses in dev tools ..

    • @Aditya-yn5lk
      @Aditya-yn5lk 6 ปีที่แล้ว

      Did you get the solution for accessing it with postman. I also need it.

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

    Hey..great job...very informative....i was searching over the net to find an oauth2 with zuul implementation where all requests to authorization and resource servers go through a zuul proxy...it will be very helpful if you can add zuul feature to this tutorial...

  • @geekgeeks2256
    @geekgeeks2256 6 ปีที่แล้ว +3

    Thank you so much Ajay..Its of great help to me :) God bless you

  • @akashdeeproy71
    @akashdeeproy71 6 ปีที่แล้ว

    Thanks for the video. I have one question
    How the access token which is provided by Authentication server is getting validated at Resource server. Because without validating if some one changes the access token then also it will work.

  • @pujaawasthi6823
    @pujaawasthi6823 6 ปีที่แล้ว

    Thank you. Could you also explain if client is web service instead of web page, which interface I have to implement on client side. I have to write rest web service client to consume oauth secure rest webservice

  • @AhmedMkhinini
    @AhmedMkhinini 6 ปีที่แล้ว

    thks. But How to make a cal for my rest services from my client using the users credentials ?

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

    also very nice work with editing the video, gives a professional feel to it

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

    Hi, When we need to go for OAuth2 and we need to go for JWT, and in which scenario goes for the certificates in the app server.

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

    May i know what is the Oauth2 version in this video?
    the one i tried, seem like no more "@EnableOAuth2Sso"

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

    Hi Ajay,
    I was looking for integration of spring boot with keycloack. Without using keycloak adapter . I want to use oauth2 and keycloak for rest api. I dont need any login screen just rest api which takes access token

  • @DovahElioth
    @DovahElioth 6 ปีที่แล้ว

    I'm having trouble follow the tutorial with spring boot 1.5.15 (not a snapshot), @EnableResourceServer tag does not exists, there is any way around that?

  • @ratikantapradhan1537
    @ratikantapradhan1537 6 ปีที่แล้ว

    Great video! Do you have a vdo of this with angular(2,4,5)? or can share some link from where I can get it?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      +Ratikanta Pradhan nope. I'm yet to learn TypeScript

    • @ratikantapradhan1537
      @ratikantapradhan1537 6 ปีที่แล้ว

      Okay, please make a video if you can after learning.
      I have this problem in angular {error: "invalid_grant", error_description: "Bad credentials"}, could you guess, what could be the error?

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

    Thanks man, just saved my life. live long

  • @rathinmaheswaran
    @rathinmaheswaran 6 ปีที่แล้ว

    Hi , perfect tutorial . thanks a lot . Could you pls let us know or post a tutorial on " OAuth 2.0 Authorization server using LDAP authentication" .It is not present anywhere around the internet.

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      +rathin maheswaran thanks. Sure. Will try mate

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

    Hi, is it possible to have two different oauth providers in the same application. And use them conditionally based on the requested url?

  • @DeepakPanda-ex7en
    @DeepakPanda-ex7en 6 ปีที่แล้ว

    Nice Video. When I run the example cloned from github I get "403 Forbidden" error. What could be the issue?

  • @sz54dc
    @sz54dc 7 ปีที่แล้ว

    thank you so much. Great tutorial. i like it. so where do i get an advance tutorial vid ?

  • @haster66
    @haster66 5 ปีที่แล้ว

    setting the token in the cookie is a major vulnerability !!! the correct implementation is that the auth code shall be sent to the server side by web redirect, and then it shall be used in a server to server call to acquire the access token. the access token shall only be used on the back channel, which is the server to server call. single page applications can utilize PKCE update on the auth code grant type.

  • @gamingkhtv778
    @gamingkhtv778 6 ปีที่แล้ว

    It's very nice
    but dont u make video about client in dynamic one more?

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

    Awesome tutorial. Unfortunately Spring don't provider a clear exception when his return a 404 status. Anyway, thanks for shared!

  • @simmy565
    @simmy565 6 ปีที่แล้ว

    Why I am getting error as "Consider revisiting the conditions above or defining a bean of type 'org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoRestTemplateFactory' in your configuration."

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

    I liked your problem-solving skills, Thank you.

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

    Would this still work currently? I followed this 100% but currently it critizies me for missing authentication and does not load the pages

  • @vidyasagarareddyagraharam9648
    @vidyasagarareddyagraharam9648 5 ปีที่แล้ว

    Hi Ajay,
    I've one requirement, I will need to get the access token using OAuth2.0 first, I don't need to redirect after getting the token, what I'll need to do is, based on this token, I will need to invoke multiple REST API's. Currently I'm stuck how to get the token alone first?. Please help me out, what changes I will need to do in properties file and in any java component file?.

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

    Thanks for this video...But I need a Combination of Angular+ Springboot with Oauth2. I have searched in youtube but I didn't find any reference with the combination of these. I am new to the Spring boot and Oauth2.

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

      Hi @venkatesh veduri
      Did you find any videos for the above issue?
      If so please do share here.
      Thanks in advance.

  • @alihussainmoosakhan3522
    @alihussainmoosakhan3522 6 ปีที่แล้ว

    Hi can you explain how can we add our custom login page instead of by default OAuth2 login page.

  • @andyhgnguyen
    @andyhgnguyen 5 ปีที่แล้ว

    Great tutorial! How about the hello() method in resource server, how can we call this method from a controller for example and display on themeleaf template?

  • @tharageshanbu5170
    @tharageshanbu5170 6 ปีที่แล้ว

    Kindly provide a video in how oauth delegates authentication to AD/LDAP. Will be so helpful

  • @CarlosAntonio-bp5gv
    @CarlosAntonio-bp5gv 6 ปีที่แล้ว

    Very good tutorial. I would like to know can we create a custom login page.

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      Yes Carlos, you can create a custom login page and use it as well.

  • @danieldelafuentes9177
    @danieldelafuentes9177 7 ปีที่แล้ว

    Awesome video, thank you very much. I need a bit of help though, I have been back & forth with the video and your GitHub & I don't see any differences with any of my code. After I login I come to a 404 page "There was an unexpected error (type=Not Found, status=404).
    /ui/secure.html" do you know what I could've done wrong? I have all dependencies, & have secure.html in templates package.

    • @TechPrimers
      @TechPrimers  7 ปีที่แล้ว

      Hi Dan, either the tomcat is not UP or the path is incorrect. can you verify them

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

    Nice video with In depth understanding of concept

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

    Can you please make the same video using database authentication and let it also include registering a new user, please.

    • @TechPrimers
      @TechPrimers  7 ปีที่แล้ว

      you can check my video on Spring Security with DB authentication. You can integrate that piece here

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

    Hi, I am using same code but I am getting this error This XML file does not appear to have any style information associated with it. The document tree is shown below.
    Full authentication is required to access this resource
    unauthorized

  • @abdulmajidkhan4355
    @abdulmajidkhan4355 7 ปีที่แล้ว

    i am able to do logout, but if i have multiple spring boot application i need to logout form each application.can i have single sign off also with oauth and spring boot?

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

    thanks for the video.. I have one question. Generally we have 2 tokens in oAuth: Auth code token and Access token. In this tutorial we have Access token. I think Auth code token is generated after authorization. where is that in our example?How and where it is used... please explain. thanks in advance.

    • @TechPrimers
      @TechPrimers  5 ปีที่แล้ว

      Access Token is used for accessing the Authorization Server. ID Token/Code Token is used for accessing your Resource Server (Eg. accessing User's data post authentication and authorization)

    • @chittimallachandrashekar2329
      @chittimallachandrashekar2329 5 ปีที่แล้ว

      @@TechPrimers Thanks for reply...... I saw 'What is OAuth2? How does OAuth2 work?' video. according to that,
      1. first client will request for Authorization, we get a token in return.
      2. next client will again request for access token by sending the above token.
      3. we get access token in the above step... that token is used for accessing the resource server (eg: for getting account details).
      My question is: we are saving the access token in cookie(ui-session), but how can I get the token which we got in step 1? Is there any way to get it ?

  • @AmitKashyap-ki3oz
    @AmitKashyap-ki3oz 6 ปีที่แล้ว

    Thank you for the presentation. quick question, if I am declaring client details(client-id, client-secret, password) in application.yml, how can we auto populate the same details in code and pass the same to OAuth2RestTemplate while calling exchange function to call API.

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      you can get it via Spring config like @Value("${client.id}")

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

    Very nice video! Can you do an exmple with an Implicit grant flow for a javascript webapp (SPA) ?

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

    Thank you very much, very good tutorial on OAuth2

  • @sivaramakrishnanulakani8879
    @sivaramakrishnanulakani8879 6 ปีที่แล้ว

    Hi Tech Primers,
    could you please explain Oauth2 with angular4 ??

  • @PraveenKumar-px6bw
    @PraveenKumar-px6bw 6 ปีที่แล้ว +2

    Simple and straight forward, Very good indeed. Thank you.

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      my pleasure Praveen. Glad that was useful

    • @PraveenKumar-px6bw
      @PraveenKumar-px6bw 6 ปีที่แล้ว +1

      In fact its good way to share knowledge and that too practical.Really Appreciate your efforts and knowledge.
      Dont know your location, any plans to work in the UK then let know, please.

    • @PraveenKumar-px6bw
      @PraveenKumar-px6bw 6 ปีที่แล้ว

      Just a quick question
      How to expose rest api with spring boot standalone app with 2 curl-able endpoints.
      • Endpoint 1 - GET /sayHai public endpoint running on port 80 that will return a json payload with the message “Hello World”.
      • Endpoint 2 - GET /manager will be a management endpoint on port 8080 that will return a json payload “Hello Management”

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      Thanks Praveen. I'm in Bangalore.

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

      Check this thread which is related to the same question you asked: stackoverflow.com/questions/36357135/configure-spring-boot-with-two-ports
      Out of curiosity - why do you need to expose them in 2 different ports? Are you targetting any specific usecase?

  • @Mohamed-uf5jh
    @Mohamed-uf5jh 4 ปีที่แล้ว

    Great Job , Thank you So much !!

  • @sathiits
    @sathiits 6 ปีที่แล้ว

    Can I get example to access third party like Facebook or google..

  • @bootavo
    @bootavo 5 ปีที่แล้ว

    Perfect, but How can I implement this AUTH on Client side using @RestController, because I configured a server auth with port:8098 and other other project like microservice with port:8092 and when I tried to call an rest-api in port:8092 and it didn't redirect to me to port:8098, just showed me a login interface but my credentials from mysql database didn't work. All the time said me "Your login attempt was not successful, try again.", Can you show us how to implement Auth2 with Client using @RestController instance of index.html?

  • @kuldipbajwa_
    @kuldipbajwa_ 6 ปีที่แล้ว

    Hi for the resourceserver didn't you need to extend the RespurceServerConfigurerAdapter?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      since i did not override any config there, i did not extend it

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

    Thanks!!

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

    good job sir

  • @nageshkumarvs1348
    @nageshkumarvs1348 5 ปีที่แล้ว

    Can you provide oauth with only rest api example

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

    Thank you for such nice tutorial.

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

    Great video bruh

  • @GuruPrasad-di9wt
    @GuruPrasad-di9wt 6 ปีที่แล้ว

    can i expect login and registration APIs with BcryptpasswordEncoder and Oauth2 with access ans refresh token, authentication based on password and role

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

    Great video. Thank you. Also if possible can you also do video on Springboot with SAML SSO.

    • @TechPrimers
      @TechPrimers  7 ปีที่แล้ว

      +Sriram Prabha sure sriram

  • @SportAnalysisKing
    @SportAnalysisKing 6 ปีที่แล้ว

    @ 30:13 resource->userInfoUri is just allowing hello resource. How do I allow multiple resources like hello, user, other?

  • @suryakumar5978
    @suryakumar5978 6 ปีที่แล้ว

    Very nice, can u pls xplain how to write oauth2 client in Springfox swagger2 implementation??

  • @anandkhot5633
    @anandkhot5633 6 ปีที่แล้ว

    When I am entering as "localhost:8082/ui/" it is redirecting me directly to "localhost:8081/auth/login" . I am not getting what could be the problem?

  • @shekarscreativethinks7603
    @shekarscreativethinks7603 5 ปีที่แล้ว

    Hi bro, can you please explain how can we login jenkins from url which is there at outlook email

  • @angadjha1253
    @angadjha1253 6 ปีที่แล้ว

    How can I make Spring Security OAuth2 work with load balancer? please help me regarding this issue
    Client sends request for the oauth token
    LB redirects the request to Box 1
    Box 1 authenticates and returns a valid Bearer Token
    Client receives the token and store it for using through the sesion
    Client sends request for a service in the REST API adding the previously retrieved token to the headers
    LB redirects the request to Box 2
    Box 2 fails to authenticate as it does not recognize the token and returns an Invalid Credentials response.

  • @ashwinpalesha7410
    @ashwinpalesha7410 5 ปีที่แล้ว

    I want to integrate google fit into my application and get data from there. How can i do this?

  • @rameshc8772
    @rameshc8772 5 ปีที่แล้ว

    Hi
    I am Ramesh, please explain me what is diff b/w restful and microservice.

  • @vaigashoyo
    @vaigashoyo 6 ปีที่แล้ว

    I am getting the same error : "Failed authenticationManager in AuthorizationServerConfig required a bean of type 'org.apringframework.security.authentication.AuthenticationManager'

  • @thilakreddymudireddi765
    @thilakreddymudireddi765 6 ปีที่แล้ว

    Hi, How Request is Redirecting to Login Page? And Where is the code for Login Page? .jsp or .html?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      It is mentioned in the SecurityConfiguration file

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

    The spring started you added is missing while i was working

  • @AtulKumar-gs8sj
    @AtulKumar-gs8sj 6 ปีที่แล้ว +1

    Can you help me with this
    Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception;
    just downloaded whole project from github and run on intelliJ

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      can you check if the jars are downloaded and ports are not used by other processes?

    • @AtulKumar-gs8sj
      @AtulKumar-gs8sj 6 ปีที่แล้ว

      The problem was with java version 1.9, i degraded it 1.8 now it`s working
      Thanks anyway

  • @Aditya-yn5lk
    @Aditya-yn5lk 6 ปีที่แล้ว +1

    Hey, Thanks for the video. Also, I have a query i.e. What If I want to access server-side APIs with Postman. Please help!

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      hey Aditya, you can take a look my Postman video for accessing server side APIs using it th-cam.com/video/8yrhSyNPalM/w-d-xo.html

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

    Given examples ....i tried in my local but unable to get the ouput...i am using this Url(localhost:8081/auth/ui/login) after login .. i am getting error like"
    Full authentication is required to access this resource
    unauthorized
    "...could you resolve this issue...

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

    Hi can i check why is your user credentials peter peter stored at the resource server? Is this method of OAuth 2.0 using local login?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      Resource Server has the User info, eg Google server.

  • @robinrusli9486
    @robinrusli9486 7 ปีที่แล้ว

    can you show us how to add more details in principal

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

    Thank you so much. It is totally worthful.

  • @get4gopi
    @get4gopi 6 ปีที่แล้ว

    You have not shown on how to access "HelloResource" rest API? localhost:8081/auth//rest/hello when I access it says 401 unauthorized.

    • @srikanthmandula7776
      @srikanthmandula7776 6 ปีที่แล้ว

      Hi, Are you able to resolve this ? I ma also facing the same error

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

    I think AuthenticationManager is redundant in ResourceServerConfig.java. You already use the inMemoryAuthentication method. And also I have made a pull request for this from GitHub. Please check and return me back if i am right or not

  • @kuldipbajwa_
    @kuldipbajwa_ 6 ปีที่แล้ว

    Can you demo this using Postman?

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

    Excellent

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

    Is there any PDF while for code or link

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

    hi bro your are doing good i have one doubt how spring boot can handle high traffic could you please answer

    • @TechPrimers
      @TechPrimers  7 ปีที่แล้ว

      Hi Anil,
      Spring Boot is using Embedded Tomcat for hosting the files. Hence its same as Tomcat.

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

    Nice contents

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

    very informative, i am able to do it with the help of your vdo, but not able to logout from all client application. pls help for logout

    • @TechPrimers
      @TechPrimers  7 ปีที่แล้ว

      expire the token for logging off.

  • @sudhiris056
    @sudhiris056 5 ปีที่แล้ว

    Doesn't work following this tutorial. It throws AuthenticationManager authowired bean exception while starting up the authorization server

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

    Hi, I have a problem when I start the server: "a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found."
    Do you know how I can solve this problem ?

    • @paulalopes9716
      @paulalopes9716 6 ปีที่แล้ว

      I had the same problem. Did you solve it?

    • @tech_gurwinder
      @tech_gurwinder 6 ปีที่แล้ว

      @Override
      @Bean
      public AuthenticationManager authenticationManagerBean() throws Exception {
      return super.authenticationManagerBean();
      }
      add this in
      class ResourceServerConfig extends WebSecurityConfigurerAdapter {

    • @tech_gurwinder
      @tech_gurwinder 6 ปีที่แล้ว

      which exception? can you please post some detail here.

    • @tech_gurwinder
      @tech_gurwinder 6 ปีที่แล้ว

      you need to define the order of your bean Use @Order at top of your class
      check here how to use order www.baeldung.com/spring-order

    • @Se7Olutionyg
      @Se7Olutionyg 6 ปีที่แล้ว

      I added @Order(1) on the top of ResourceServerConfig class but still have the same error. can you please help

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

    This example will not work in Spring Boot > 2.0.0.M4.
    Looks like the @EnableOAuth2Sso have been moved to :
    'org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.0.0.RELEASE'
    also problems with AuthenticationManager in Spring Boot > 2.0.0.M4 are discussed here:
    github.com/spring-projects/spring-boot/issues/11136