security - Keycloak 支持一个域名上的一个领域,同时服务于多个域
问题描述
我正在使用 keycloak 作为身份验证/授权提供者在 kubernetes 上构建应用程序生态系统。我正在(或可能正在)计划通过 OpenId(OAuth2) 将所有内容与其集成,并且用户凭据和其他私人信息永远不要以未加密的形式离开 keycloak 实例。
我试图在考虑以下配置的情况下实现整个身份验证方案。
领域
myservice: Realm containing the public and back-office users of my application.
All microservices that I have are authenticating users against this realm.
master: Contains admins, keycloak administrators and other resources which
should not be ever exposed to the public or intranet users. No microservice
ever performs authentication on this realm.
域
1. domain: account.myservice.com
access: public
cors: allow requests from app.myservice.com
config: kubernetes-ingress
exposes: configured themes to support login, registration, etc.. Endpoints
for public front-end application token validation
description: Only exposes access to a realm called "myservice" in keycloak.
No users from other realms can login or interact.
2. domain: account.internal.myservice.com
access: intranet/admins
cors: allow requests from back-office.internal.myservice.com
config: kubernetes-ingress
exposes: configured themes to support login, registration, etc.. Endpoints
for back-end front-end application token validation
description: Exposes all the realms and provides access to keycloak
administrative UI.
3. domain: keycloak (keycloak.default.svc.cluster.local)
access: cluster-internal
cors: none
config: kubernetes service, visible only inside the cluster
exposes: endpoints for back-end application token validation
description: Only exposes realm "myservice" and is used for other services to
validate user tokens and similar stuff.
在尝试实现上述配置方案时,我确实遇到了许多问题。如果我在 Keycloak 中进行 SSL 终止,我将无法通过反向代理或类似方法配置不同的域,这反过来意味着 Keycloak 应该提供一种功能来监听单独的 SSL 加密端口并且只创建一个域在那里可用。它没有。所以我想要一些奇怪的东西吗?最佳实践与我想要的不同吗?
解决方案
推荐阅读
- python - 使用 OpenCV 识别前景色和背景色
- c++ - 如何从嵌套的 PROGMEM 数组中读取 uint32_t 值?
- python - Python 从父目录导入模块,Flask Unittest 示例
- c# - 如何在WPF C#中将鼠标悬停在进度条上
- r - 我们如何在 R 中获得以 KB、MB、GB、TB 为单位的格式化文件大小?
- gnuplot - 为什么 gnuplot 启动后终端大小未定义?
- php - 如何解决尝试获取非对象的属性“sub_cat_name”
- r - clusters proc - 尝试将 sas 转换为 R-
- rasa-nlu - 'rasa' 未被识别为内部或外部命令
- javascript - 这让我发疯 - 第 42:40 行:'firebase' 未定义 no-undef