Spring Boot Microservices Tutorial - Part 6 - Security using Keyloak

Sdílet
Vložit
  • čas přidán 19. 04. 2024
  • In this Spring Boot 3 Microservices tutorial series, we will learn how to build microservices using Spring Boot and Spring Cloud.
    This is part 6 of the series, in this part, we will cover:
    - Brief introduction about Keycloak
    - How to configure API Gateway using Keycloak

Komentáře • 33

  • @ProgrammingTechie
    @ProgrammingTechie  Před 2 měsíci

    Link to the written tutorial: programmingtechie.com/2024/04/18/spring-boot-microservices-tutorial-part-4/

  • @manjunathasathyanarayana1508
    @manjunathasathyanarayana1508 Před 2 měsíci +1

    nice. All six parts integrated and working. thanks
    Lot of new learning
    Wiremock,RestAssured,Flyway,keyloak.

  • @andrew_nguyen05
    @andrew_nguyen05 Před 2 měsíci +1

    Thank you a lot! I was waiting for this video for so long

  • @rishiraj2548
    @rishiraj2548 Před 2 měsíci

    Great thanks

  • @yushad1397
    @yushad1397 Před 29 dny

    Thank you for your work.
    How to achieve method-level security?
    I don’t think it is possible with this approach

  • @mohammedabbutalha2793
    @mohammedabbutalha2793 Před 2 měsíci

    I am desperately waiting for your next tutorial when is it coming up?

  • @jrgokavalsa
    @jrgokavalsa Před 2 měsíci +1

    Hey Sai,can you make some videos on docker and docker compose

  • @_PrachiTodkari
    @_PrachiTodkari Před 2 měsíci

    Please create a video on distributed transaction in microservice using saga design pattern.

  • @ap0xF
    @ap0xF Před 2 měsíci

    In next tutorial please tell, how can we avoid auth for certain microservices?

  • @dhayananthdhaya6608
    @dhayananthdhaya6608 Před 2 měsíci

    waiting for next video

  • @mateuslevi1300
    @mateuslevi1300 Před 2 měsíci

    part 6 - checked

  • @e11y1985
    @e11y1985 Před měsícem

    At 16:42 you talk about id_token. But this is not the case for me. Any Idea why id_token not show to me? I see only the access token.

  • @mohammedabbutalha2793
    @mohammedabbutalha2793 Před 2 měsíci

    when are upcoming videos going to be uploaded? Am eagerly waiting for it

  • @Nadim-qk4sh
    @Nadim-qk4sh Před 2 měsíci

    hi thank you for the tutorials
    im sucessfully using keycloak on the api gateway
    yet i still can access the product services using their original port and endpoints without the need of authentication
    is there any way to force all the microservices to be exclusively accessed only using the api gateway ?
    Thank you

    • @ProgrammingTechie
      @ProgrammingTechie  Před 2 měsíci +2

      Hi, good question.
      Yes, usually when you deploy this in a production grade setup, the microservies are deployed within a corporate firewall, and will have firewall rules to allow access only from certain hosts, in this case this can be API Gateway.
      Also we can use Mutual TLS to make sure our microservices only respond to trusted clients like API Gateway.
      Another approach is securing also each and every microservice, in this way the API Gateway will send an access token to access the other services, this is more secure, but there will be additional latency and involves more complexity because each microservice should now verify the access token against the Auth Server.

    • @Nadim-qk4sh
      @Nadim-qk4sh Před 2 měsíci

      @@ProgrammingTechie thank youuu for the insight 🙏

  • @pradeepravi9608
    @pradeepravi9608 Před 2 měsíci

    can u please add the github link for the tutorials sir ?

  • @mohammedabbutalha2793
    @mohammedabbutalha2793 Před 2 měsíci

    And are you not implementing the service discovery?

    • @ProgrammingTechie
      @ProgrammingTechie  Před 2 měsíci

      Yes, as we are deploying using Kubernetes this feature will be available for us out of the box, no use in creating the discovery server and then removing it.

  • @defrankline
    @defrankline Před 2 měsíci

    Kindly implement a normal jwt user authentication with users and roles

    • @ProgrammingTechie
      @ProgrammingTechie  Před 2 měsíci +2

      I will not do it in this series, because this setup is rarely used in the real world. Sure there is the concept of Users, roles, etc. But you don't see companies implementing their Authentication setup because it can be tricky and hard to do it right. That's why Auth Servers like Keycloak, and Okta are famous these days and widely used.
      But I have plans to create a separate video, where I will explain in detail how to work with Spring Security using JWT.

    • @defrankline
      @defrankline Před 2 měsíci

      @@ProgrammingTechie thanks brother. Surely i will wait for that video!

  • @Hakan-mg2qj
    @Hakan-mg2qj Před 2 měsíci

    Hello dear Sai, If we want to install keycloak to custom domain. What can we do? So, what if we want to using live project how can we settle it to public? Could you suggest any documentation? And could we use this for angular requests by some libraries?

    • @souravsuman1993
      @souravsuman1993 Před 2 měsíci

      there is keycloak-js library which works with all angular, react, vue and many more. you can use that npm library. for custom domain you have to buy your domain and redirect your request to that domain which will be bind to keycloak ip and port.

    • @Hakan-mg2qj
      @Hakan-mg2qj Před 2 měsíci

      ​@@souravsuman1993 Thanks for your response. Just a question I wanna ask, in the video, security settled for client like postman etc. When we want to auth to browser(react etc.) ,which issuer-uri, dependency or client will we use? And is there register method in this keycloak? Thanks for your answer again I am so glad

    • @ProgrammingTechie
      @ProgrammingTechie  Před 2 měsíci

      For Angular, you can use this library github.com/manfredsteyer/angular-oauth2-oidc
      You can refer to my Keycloak Tutorial, I explained all the use cases in detail in that tutorial and also demonstrated how to integrate Keycloak along with Angular using the above library.
      If you want to authorize the client through a browser, then you have to use Authorization Code Flow Grant Type instead of Client credentials.
      Keycloak provides you all the functionality like register, login, 2 Factor Authentication, Single Sign On out of the box with minimal code changes.

  • @nailtagiyev6340
    @nailtagiyev6340 Před 2 měsíci

    My 16 GB RAM is dead now)))

    • @ProgrammingTechie
      @ProgrammingTechie  Před 2 měsíci +1

      I know the pain, this is happening because now may be you have multiple IntelliJ IDE instances running the services.
      I would suggest you to create a Maven Multi Module Project so that you will have all the projects in one maven project and only one IDE instance running all the services, you can see how to do that in this video - czcams.com/video/lh1oQHXVSc0/video.html

    • @nailtagiyev6340
      @nailtagiyev6340 Před 2 měsíci

      @ProgrammingTechie Thank you for the advice, I will try🙏

    • @manoprasath9202
      @manoprasath9202 Před 27 dny

      @@ProgrammingTechie
      I tried it. But when I run the application I'm getting
      SQL State : 42000
      Error Code : 1049
      Message : Unknown database 'order_service' error.
      Docker is not picking the init.sql file.
      docker-compose file:
      version: '4'
      services:
      mysql:
      image: mysql:8.3.0
      container_name: mysql
      ports:
      - "3316:3306"
      environment:
      MYSQL_ROOT_PASSWORD: mysql
      volumes:
      - ./order-service/mysql/data:/var/lib/mysql
      - ./order-service/docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
      Path of Init file: D:\IntelliJ_Projects\Spring_Microservices\shopping-microservices\order-service\docker\mysql\init.sql