Тёмный
No video :(

How to Implement MultiTenancy with Spring Boot and Keycloak 

czetsuyatech
Подписаться 1,3 тыс.
Просмотров 10 тыс.
50% 1

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: github.com/cze...
-- Paid Gig --
I'm currently offering paid consultation and development gigs to help with your application development. Follow this link for more details czetsuya-tech.....
-- 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: www.paypal.me/...
- Patreon: / czetsuya
---- About this Channel ----
I am Edward Legaspi, the content creator of Czetsuya Tech.
And I create RU-vid 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
czetsuya.githu...
- 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

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 36   
@AhmedKhaled-he9mf
@AhmedKhaled-he9mf 2 года назад
Thanks very much, you saving my time and helped me
@czetsuyatech
@czetsuyatech 2 года назад
Glad I could help.
@user-qt7xv1ke4w
@user-qt7xv1ke4w 11 месяцев назад
Hello, Great content!! Any updates about the spring 3 / spring security 6 implementation ?
@czetsuyatech
@czetsuyatech 11 месяцев назад
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 2 года назад
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 2 года назад
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.
@mohamedbasuney8871
@mohamedbasuney8871 Год назад
Can we implement this using oauth2 with keycloak ?
@czetsuyatech
@czetsuyatech Год назад
Hi. I haven't tried that.
@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.
@luqmanahmed1400
@luqmanahmed1400 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.
@vivekdhakre792
@vivekdhakre792 2 года назад
can you please help for logout because I am not understanding logout for the same multitenant example?
@czetsuyatech
@czetsuyatech 2 года назад
Hi. One way you could achieve it is via HttpServletRequest.logout as documented here www.keycloak.org/docs/latest/securing_apps/#logout.
@26PRITISH
@26PRITISH 3 года назад
nice informative video
@czetsuyatech
@czetsuyatech 3 года назад
Thanks. Hope this helps.
@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 года назад
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 года назад
@@czetsuyatech yes you are right, Thanks very much
@SuperAdil08
@SuperAdil08 Год назад
Thx man
@czetsuyatech
@czetsuyatech Год назад
Hey. Did you figured it out? You can check the repository that I shared for samples.
@SuperAdil08
@SuperAdil08 Год назад
@@czetsuyatech yes and im using it now in my current project thx for sharing
@faridboucif3705
@faridboucif3705 3 года назад
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 3 года назад
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 3 года назад
@@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 3 года назад
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 3 года назад
@@czetsuyatech Thanks a lot for the advice.
@czetsuyatech
@czetsuyatech 3 года назад
You're welcome. If you would like to support these tutorials I have a Patreon account where you could contribute at patreon.com/czetsuya.
@VikashGupta-wu2fc
@VikashGupta-wu2fc Год назад
Can we implement same with oauth2.0 ?
@czetsuyatech
@czetsuyatech Год назад
Hi, what exactly do you mean?
@VikashGupta-wu2fc
@VikashGupta-wu2fc Год назад
@@czetsuyatech how can I connect with you?
@VikashGupta-wu2fc
@VikashGupta-wu2fc Год назад
@@czetsuyatech i want ot implement multitenant on spring cloud gateway.
Далее
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11
Х.евая доставка 😂
00:23
Просмотров 1,3 млн
Multi-tenant architecture in 20 minutes
18:56
Просмотров 112 тыс.
Multi-tenant Architecture for SaaS
11:07
Просмотров 112 тыс.
It's time for change, it's time for Linux.
10:53
Просмотров 283 тыс.
Brutally honest advice for new .NET Web Developers
7:19
Spring Tips: The Spring Authorization Server
22:21
Просмотров 16 тыс.
I forced EVERYONE to use Linux
22:59
Просмотров 457 тыс.