How to Implement MultiTenancy with Spring Boot and Keycloak

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ม.ค. 2025

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

  • @AhmedKhaled-he9mf
    @AhmedKhaled-he9mf 2 ปีที่แล้ว

    Thanks very much, you saving my time and helped me

  • @NajmeddineLouhichi
    @NajmeddineLouhichi ปีที่แล้ว

    Hello, Great content!! Any updates about the spring 3 / spring security 6 implementation ?

    • @czetsuyatech
      @czetsuyatech  ปีที่แล้ว

      Hi. Yes I'm finalizing a full product implementation of multi-tenancy with Keycloak and Spring Boot 3. Should be release soon for my sponsors.

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

    Very useful content thanks. I would like to know your view on achieving multi-tenancy on application level. Where we can create realms dynamically.

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

      Hi Ghayour, sure what specific question do you have? We have this particular requirement before where we need to create a new realm and database schema (Postgres) for every new customer. I remember we have some Java scripts to automate this and then dynamically load the database connection (Wildfly) base on a certain parameter.

  • @26PRITISH
    @26PRITISH 4 ปีที่แล้ว

    nice informative video

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

      Thanks. Hope this helps.

  • @SuperAdilMorocco
    @SuperAdilMorocco ปีที่แล้ว

    Thx man

    • @czetsuyatech
      @czetsuyatech  ปีที่แล้ว

      Hey. Did you figured it out? You can check the repository that I shared for samples.

    • @SuperAdilMorocco
      @SuperAdilMorocco ปีที่แล้ว

      @@czetsuyatech yes and im using it now in my current project thx for sharing

  • @AhmedKhaled-he9mf
    @AhmedKhaled-he9mf 2 ปีที่แล้ว

    please question,
    in class PathBasedConfigResolver, you save the realm from config Client and put in map it as key realm,
    if I have multi clients for same realm in this case will override the previous saved realm, right ?
    please how we can do it ?

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

      Hi Ahmed. Yes, but isn't that supposed to be the case? Normally, you have a realm with all it's clients exported on a single keycloak.json file. Are you saying you want a tuple (realm, client) as each keycloak.json file?

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 2 ปีที่แล้ว

      @@czetsuyatech you are right it's not good design to be multi client for same realm, unfortunately requirement business ☹

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 2 ปีที่แล้ว

      Yes please that's I mean tuple(realm, client) as each keycloak.json file,
      Please how can do it or multi clients in same realm ?
      And thanks very much for your efforts and response

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

      Hi @Ahmed, how about having a keycloak.json file for each (realm, client) tuple and then use the client code/name for the filename and cache key? Something like realmCode_clientCode-keycloak.json.

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 2 ปีที่แล้ว +1

      @@czetsuyatech yes you are right, Thanks very much

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

    Wish if you can teach us that how to implement keycloak multi tenant login on react app.

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

      Hi Luqman, that's an interesting topic. I'll try to work on a video when I have time.

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

    Hello i hope you are fine .., so can you do a vedio to explain how we can configurat multi tenancy using spring security hibernet and postgresql. Thank you.

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

      Hi Tarchoun. This is noted and I added to my pipeline of todo video. Hope this video helps. Thanks for watching.

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

    can you please help for logout because I am not understanding logout for the same multitenant example?

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

      Hi. One way you could achieve it is via HttpServletRequest.logout as documented here www.keycloak.org/docs/latest/securing_apps/#logout.

  • @mohamedbasuney8871
    @mohamedbasuney8871 ปีที่แล้ว

    Can we implement this using oauth2 with keycloak ?

  • @VikashGupta-wu2fc
    @VikashGupta-wu2fc 2 ปีที่แล้ว

    Can we implement same with oauth2.0 ?

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

      Hi, what exactly do you mean?

    • @VikashGupta-wu2fc
      @VikashGupta-wu2fc 2 ปีที่แล้ว

      @@czetsuyatech how can I connect with you?

    • @VikashGupta-wu2fc
      @VikashGupta-wu2fc 2 ปีที่แล้ว

      @@czetsuyatech i want ot implement multitenant on spring cloud gateway.

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

    Hello and thank you for videos. can you make a video about how to setup keycloak with mysql database step by step in your local machine. i tried before but i did not succeed. i want to start a project for ads. i want to setup keycloak as authentication server. what advice can you give me about this. Thank you

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

      Hi. I already have a video for that available at www.czetsuyatech.com/2020/06/how-to-run-keycloak-with-mysql-database-on-docker.html. Only this blog is using docker to run Keycloak. What cloud provider are you going to use to host your project and Keycloak?
      PS: I do consultation as a side gig so feel free to message me if you need help www.czetsuyatech.com/p/consultation-services.html.

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

      @@czetsuyatech Thank you very much for your response. I am new in cloud environment development (microservices, docker, kubernetes). For the cloud provider maybe i will choose the cheapest :) AWS or Google or other. Thank you for your help, if i need help i will message you.

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

      Both AWS and GCP offer free tiers so choosing either of them is fine. The important thing is you get familiar with them. Before spinning up any of their services make sure that you are 100% sure how much the cost would be whether it is covered by the free tier or not. Even if you spin a free tier EC2, you still have to pay for your domain name (if needed) and routing.

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

      @@czetsuyatech Thanks a lot for the advice.

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

      You're welcome. If you would like to support these tutorials I have a Patreon account where you could contribute at patreon.com/czetsuya.