User Tools

Site Tools


сервис_keycloak

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_keycloak [2025/12/17 20:37]
val [LDAP]
сервис_keycloak [2026/02/20 13:59] (current)
val [Kubernetes]
Line 115: Line 115:
  
   * [[Сервис PostgreSQL]]   * [[Сервис PostgreSQL]]
 +  * Kubernetes [[Система Kubernetes#​Ingress]]
   * Kubernetes [[Система Kubernetes#​secrets tls]]   * Kubernetes [[Система Kubernetes#​secrets tls]]
  
 <​code>​ <​code>​
 ~/$ helm repo add bitnami https://​charts.bitnami.com/​bitnami;​ helm search repo bitnami/​keycloak --versions; helm repo remove bitnami ~/$ helm repo add bitnami https://​charts.bitnami.com/​bitnami;​ helm search repo bitnami/​keycloak --versions; helm repo remove bitnami
-...403 Forbidden+Бывает...403 Forbidden
  
 ~/$ KC_HC_VER=17.3.6 ~/$ KC_HC_VER=17.3.6
Line 134: Line 135:
   * Kubernetes [[Система Kubernetes#​Volumes]]   * Kubernetes [[Система Kubernetes#​Volumes]]
   * [[https://​www.keycloak.org/​server/​reverseproxy]]   * [[https://​www.keycloak.org/​server/​reverseproxy]]
 +
 +  * !!! Вариант со встроенным postgres может завершиться ошибкой загрузки (не удается указать bitnamilegacy),​ можно заменить на внешний,​ устанавливаемый через [[Сервис PostgreSQL#​Helm]] с указанием bitnamilegacy
  
 <​code>​ <​code>​
Line 153: Line 156:
 ingress: ingress:
   enabled: true   enabled: true
-  ​ingressClassName:​ nginx+#  ​ingressClassName:​ nginx 
 +#  ingressClassName:​ traefik
   hostname: keycloak.corpX.un   hostname: keycloak.corpX.un
 #  tls: true #  tls: true
Line 182: Line 186:
 #  password: strongpassword #  password: strongpassword
  
-##​extraVolumeMounts:​ +###​extraVolumeMounts:​ 
-##- mountPath: /​opt/​bitnami/​keycloak/​themes +###- mountPath: /​opt/​bitnami/​keycloak/​themes 
-##  name: themes +###  name: themes 
-##​extraVolumes:​ +###​extraVolumes:​ 
-##- emptyDir: {} +###- emptyDir: {} 
-##  name: themes+###  name: themes
  
 #​initContainers:​ #​initContainers:​
Line 201: Line 205:
 #  volumeMounts:​ #  volumeMounts:​
 #  - mountPath: /​opt/​bitnami/​keycloak/​themes #  - mountPath: /​opt/​bitnami/​keycloak/​themes
-##    name: themes+###    name: themes
 #    name: empty-dir #    name: empty-dir
 #    subPath: app-themes-dir #    subPath: app-themes-dir
Line 266: Line 270:
 может понадобиться включить может понадобиться включить
     Direct access grants     Direct access grants
 +    ​
 +для ограничения доступа через client-secret можно настроить:​
 +    Client authentication:​ yes
 +    Credentials  ​
 +      Client Authenticator:​ Client ID and Secret
 +      Client Secret: будет сгенерирован,​ надо скопировать вместо "​anystring"​
 +    ​
 +для передачи списка групп в токене понадобится:​
 +Client scopes -> 
 +  Create client scope -> Name: groups
 +    Configure a new mapper: Groups Membership
 +      Name: groups
 +    Configure a new mapper: Audience ​ !!! Для "​подсовывания"​ токена в .kube/​config
 +   Name (и везде):​ any-client
 +
 +Clients -> any-client
 +  Client scopes
 +  Add client scopes to any-client: groups
 +  Add: Default
 +  ​
 +Include in token scope ?
 +  ​
 +Add to lightweight access token ?
 +
 +Token Claim Name: groups
 +Full group path: No
 </​code>​ </​code>​
  
-==== Проверка ====+==== Проверка получения токена ====
  
   * [[Материалы по Windows#​Windows CA для Linux сервисов]]   * [[Материалы по Windows#​Windows CA для Linux сервисов]]
Line 294: Line 324:
 <​code>​ <​code>​
 -----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
-...+ ​...Второй сертификат...
 -----END CERTIFICATE----- -----END CERTIFICATE-----
 </​code>​ </​code>​
Line 367: Line 397:
 Bind type: simple Bind type: simple
 Bind DN: uid=admin,​cn=users,​cn=accounts,​dc=corpX,​dc=un Bind DN: uid=admin,​cn=users,​cn=accounts,​dc=corpX,​dc=un
 +Bind credentials:​ strongpassword
  
 Edit mode: READ_ONLY Edit mode: READ_ONLY
Line 382: Line 413:
  
 Mappers ->  Mappers -> 
-  ​first name -> LDAP Attribute: givenname + 
-  groups -LDAP Groups DN: cn=groups,​cn=accounts,​dc=corpX,​dc=un+  Name: first name 
 +  ​LDAP Attribute: givenname 
 + 
 +  ​Name: groups 
 +  Mapper type: group-ldap-mapper 
 +  ​LDAP Groups DN: cn=groups,​cn=accounts,​dc=corpX,​dc=un 
 +  Relative creation DN: cn 
 +  Group Name LDAP Attribute: cn 
 </​code>​ </​code>​
  
сервис_keycloak.1765993021.txt.gz · Last modified: 2025/12/17 20:37 by val