сервис_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 [2024/08/31 12:19]
val [Kubernetes]
сервис_keycloak [2025/01/05 11:57] (current)
val [Kubernetes]
Line 79: Line 79:
  
   * [[https://​github.com/​bitnami/​charts/​tree/​main/​bitnami/​keycloak]]   * [[https://​github.com/​bitnami/​charts/​tree/​main/​bitnami/​keycloak]]
 +  * [[https://​github.com/​bitnami/​charts/​tree/​keycloak/​17.3.6/​bitnami/​keycloak]]
   * [[https://​github.com/​helm/​helm/​issues/​11000|issues:​ helm search repo chart <​oci-repo/​oci-chart>​ --versions for OCI]]   * [[https://​github.com/​helm/​helm/​issues/​11000|issues:​ helm search repo chart <​oci-repo/​oci-chart>​ --versions for OCI]]
  
Line 119: Line 120:
 #    username: bn_keycloak #    username: bn_keycloak
 #    password: "​strongpassword"​ #    password: "​strongpassword"​
 +
 +#​extraVolumeMounts:​
 +#- mountPath: /​opt/​bitnami/​keycloak/​themes
 +#  name: themes
 +#​extraVolumes:​
 +#- emptyDir: {}
 +#  name: themes
 +
 +#​initContainers:​
 +#- name: get-theme
 +#  image: curlimages/​curl
 +#  command: ["/​bin/​sh",​ "​-c"​]
 +#  args:
 +#  - |
 +#    cd /​opt/​bitnami/​keycloak/​themes/​
 +#    curl https://​val.bmstu.ru/​unix/​Media/​mytheme.tgz | tar -xvzf -
 +#  securityContext:​
 +#    runAsUser: 1001
 +#  volumeMounts:​
 +#  - mountPath: /​opt/​bitnami/​keycloak/​themes
 +#    name: themes
 </​code><​code>​ </​code><​code>​
 ~/keycloak$ ###helm template my-keycloak -f values.yaml oci://​registry-1.docker.io/​bitnamicharts/​keycloak -n my-keycloak-ns --version 17.3.6 | less ~/keycloak$ ###helm template my-keycloak -f values.yaml oci://​registry-1.docker.io/​bitnamicharts/​keycloak -n my-keycloak-ns --version 17.3.6 | less
Line 305: Line 327:
  
 ===== Дополнительные материалы ===== ===== Дополнительные материалы =====
 +
 +==== API ====
 +
 +  * [[https://​gist.github.com/​luciddreamz/​83a888eedd9274b4045a3ab8af064faa|luciddreamz/​keycloak.sh]]
 +
 +<​code>​
 +debian:~# cat keycloak.sh
 +#!/bin/bash
 +
 +#export KEYCLOAK_URL=https://​portal.bmstu.ru
 +export KEYCLOAK_URL=https://​portal-demo.bmstu.ru
 +export KEYCLOAK_REALM=ph
 +export KEYCLOAK_CLIENT_ID=superuser
 +export KEYCLOAK_CLIENT_SECRET=XXXXXXXXXXXXXXXXXXXX
 +#export USER_ID=391530c1-c4f2-4838-bb95-def2c8e37e57
 +
 +export TKN=$(curl -X POST "​${KEYCLOAK_URL}/​auth/​realms/​${KEYCLOAK_REALM}/​protocol/​openid-connect/​token"​ \
 + -d "​username=${KEYCLOAK_CLIENT_ID}"​ \
 + -d "​password=${KEYCLOAK_CLIENT_SECRET}"​ \
 + -d '​grant_type=password'​ \
 + -d '​client_id=ph-master'​ | jq -r '​.access_token'​)
 +
 +echo $TKN
 +
 +#curl -vvv -X GET "​${KEYCLOAK_URL}/​auth/​admin/​realms/​${KEYCLOAK_REALM}/​users/​${USER_ID}"​ \
 +curl -vvv -X GET "​${KEYCLOAK_URL}/​auth/​admin/​realms/​${KEYCLOAK_REALM}/​users/?​q=username:​ivanovii"​ \
 +-H "​Accept:​ application/​json"​ \
 +-H "​Authorization:​ Bearer ${TKN}"​ | jq .
 +
 +</​code>​
  
 ==== K8S ==== ==== K8S ====
сервис_keycloak.1725095990.txt.gz · Last modified: 2024/08/31 12:19 by val