How to Implement MultiTenancy with Spring Boot and Keycloak

Опубликовано: 04 Октябрь 2024
на канале: czetsuyatech
10,286
114

Secure your web application using different Keycloak realms in a single Keycloak instance.

In some cases, we need to secure a single web application with different realms. This concept is called multi-tenancy. The realms can be located on a single or different Keycloak instance. While it's easier to have a single realm per app, it could be costly as you have to host them on different servers.

Keycloak makes it possible by offering a config resolver that can be customized and where the Keycloak adapter config can be loaded and initialized. The configuration file from different realms will be saved in the project and loaded depending on a parameter. The realm name can be defined in the query parameter, header, or for this blog in the path parameter.

Github Repository: https://github.com/czetsuya/spring-ke...

-- Paid Gig --

I'm currently offering paid consultation and development gigs to help with your application development. Follow this link for more details https://czetsuya-tech.blogspot.com/p/....

-- Help Us Grow --

Help us build an online community where software engineering students and professionals can have discussions about the fundamentals and advanced concepts of programming, current tech trends & job opportunities, and the struggles & life wins of programmers.

Discord:   / discord  
FB Page:   / czetsuyatech  

-- Channel Support --

I hope I was able to impart some knowledge that could be of help to your personal life or professional career. SUBSCRIBE to my channel and hit the bell icon to get updated when new videos are uploaded.

Want to help SUPPORT my channel? Thank you in advance!

PayPal: https://www.paypal.me/czetsuya
Patreon:   / czetsuya  

---- About this Channel ----

I am Edward Legaspi, the content creator of Czetsuya Tech.

And I create Youtube Tutorials and Write Blog Articles that
Teach beginner and advance concepts of programming and software engineering design and development.
Share my life experiences as a remote programmer.
Introduce remote-work as a source of income.

Topics included in my videos and blogs are:
Software Engineering
Databases
DevOps
Tips and Tricks on being a Programmer
WordPress Website Development
Remote Work Environment, Tools, & Stories

With your support, I'll be able to produce more, well-researched, and high-quality learning videos and blog posts. I would be most grateful for any support.

I believe that by sharing this knowledge we can empower a community of tech people who have the passion and vision to develop tech that will make this world a better place to live.

Thank you always for all your support!

Website
https://czetsuya.github.io/
Facebook:
  / czetsuya  
Linkedin:
  / czetsuya  
Twitter:
  / czetsuya  

-- Disclaimer --

Keep in mind that I may receive commissions when you click on the links and make purchases, they will help support this channel. However, this does not impact the content of the videos. I'm trying my best to keep things base on my experience, fair and balanced, in order to help you make the best choice.

#czetsuyatech