Skip to main content

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

Release files for NEMO-keycloak 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for NEMO-keycloak 1.3.1
File Interpreter ABI Platform
NEMO_keycloak-1.3.1-py3-none-any.whl Python 3 none any Details

Release files / NEMO_keycloak-1.3.1-py3-none-any.whl

Download URL NEMO_keycloak-1.3.1-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1d7bc1278cb44db57826606c93b9169a78cdb042d6307ef5be42c872034357b
BLAKE2b-256 checksum
How to use checksums
a4bc76f1330cff51ca65f76fc7c581473e00d37ee1915603f799c0d1b67caf54
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.3.1 This release

1 release file

1.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page