Skip to main content

keycloak cli tool

Project description

Keycloak_sync

Build Status

Sync users with keycloak by providing a csv file.

Features

  • Sync users with csv files
  • Export users to csv files
  • Delete users from csv files
  • Sync users from Google Object Stroage

Tech

Keycloak_sync uses a number of open source projects to work properly:

  • [python-keycloak]
  • [pandas]
  • [numpy]
  • [PyYAML]
  • [Cerberus]
  • [coloredlogs]
  • [click]
  • [colorama]
  • [google-cloud-storage]

And of course Keycloak_sync itself is open source with a public repository on GitHub.

Installation

Keycloak_sync requires python v3.8+ to run.

Install the dependencies and devDependencies and start the cli.

cd keycloak_sync
poetry install
poetry run entrypoint.py --help

CLI

pip install keycloak_sync

kcctl --version
kcctl --help
kcctl sync --help
kcctl export --help
kcctl delete --help

Sync

KEYCLOAK_SERVER_URL='https://keycloak.com/auth/' \
KEYCLOAK_REALM_NAME='keycloak-realm' \
KEYCLOAK_CLIENT_ID='keycloak-api' \
KEYCLOAK_CLIENT_SECRET='**********' \
CSV_FILE_TEMPLATE='~/template.yaml' \
CSV_FILE_NAME='~/users.csv' \
kcctl sync

Delete

KEYCLOAK_SERVER_URL='https://keycloak.com/auth/' \
KEYCLOAK_REALM_NAME='keycloak-realm' \
KEYCLOAK_CLIENT_ID='keycloak-api' \
KEYCLOAK_CLIENT_SECRET='**********' \
CSV_FILE_TEMPLATE='~/template.yaml' \
kcctl delete

Export

KEYCLOAK_SERVER_URL='https://keycloak.com/auth/' \
KEYCLOAK_REALM_NAME='keycloak-realm' \
KEYCLOAK_CLIENT_ID='keycloak-api' \
KEYCLOAK_CLIENT_SECRET='**********' \
CSV_FILE_TEMPLATE='~/template.yaml' \
CSV_FILE_NAME='~/users.csv' \
kcctl export

Docker

Keycloak_sync is very easy to install and deploy in a Docker container.

By default, the Docker will expose port 8080, so change this within the Dockerfile if necessary. When ready, simply use the Dockerfile to build the image.

cd keycloak_sync
docker build -t <youruser>/Keycloak_sync:${package.version} .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keycloak_sync-1.0.0.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

keycloak_sync-1.0.0-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page