Skip to main content

Install Keycloak plugin for NEMO

Project description

NEMO plugin to add Keycloak support to your NEMO instance.

http://www.keycloak.org/

Keycloak

The following example are using the docker image.

start Keycloak

docker run –name keycloak jboss/keycloak:10.0.2

add admin user

docker exec -it keycloak /opt/jboss/keycloak/bin/add-user-keycloak.sh -u admin

in Keycloak, add your Realm “NEMO” then create a client “nemo-client”, select confidential access-type, set the ‘Root URL’ to your nemo URL (without trailing slash) and set the ‘Valid Redirect URIs’ to ‘/login-complete’ add users in Keycloak with matching username in NEMO

Usage

install library

pip install NEMO-keycloak

add to your INSTALLED_APPS:

‘NEMO_keycloak’,

add middleware:

‘NEMO_keycloak.middleware.BaseKeycloakMiddleware’,

add backend:

AUTHENTICATION_BACKENDS = [‘NEMO_keycloak.auth.backends.KeycloakAuthorizationCodeBackend’]

add to context_processors:

‘NEMO.context_processors.show_logout_button’,

add (if needed based on your keycloak config):

KEYCLOAK_TOKEN_USERNAME_FIELD = “preferred_username”

in NEMO, run:

python manage.py migrate NEMO_Keycloak

python manage.py keycloak_create_realm <REALM_name> <server_URL> <client_id> <secret>

Known Issue

Keycloak has a known issue with audience, to fix it update your client scope “roles” and add a mapper type audience with nemo client name in it

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NEMO_keycloak-1.3.0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file NEMO_keycloak-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: NEMO_keycloak-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for NEMO_keycloak-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc598ada6a598c70b8a091eb911426502efd0057f71b94b4644274736cd0b342
MD5 569d0e4822b38a4add9a68c81e0a7656
BLAKE2b-256 98f0b4fdff1f08ae0e2cf591f9ef78626c4442bce997dc41211feb2803fc2287

See more details on using hashes here.

Supported by

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