Git Product home page Git Product logo

directus-keycloak's Introduction

Configure Directus to use Keycloak as Authentication Provider

POC, run locally using Docker-compose. Builds a new Directus Docker image, overwriting the Okta Oauth config to work with Keycloak.

Users still need to be pre-created in Directus before they can log in via Keycloak. Password etc can be left NULL though.

Services

Local setup

In /etc/hosts, add 127.0.0.1 keycloak.

Run:

docker-compose up --build
docker-compose run --rm directus install --email [email protected] --password secret-admin

Config

Config Keycloak:

  • Add Realm
    • "directus"
  • Users -> Add
  • Create client
    • "directus"
    • Access Type: "confidential"
    • Redirect URI: http://localhost:8081/*
    • Save
    • Go to "Credentials" and copy to docker-compose.yml
  • Restart docker-compose

Config Directus:

You can now login as [email protected] through Okta.

http://localhost:8082/auth/realms/directus/.well-known/openid-configuration

Example user entry:

INSERT INTO `directus_users` (
    `id`,
    `status`,
    `role`,
    `first_name`,
    `last_name`,
    `email`,
    `password`,
    `token`,
    `timezone`,
    `locale`,
    `locale_options`,
    `avatar`,
    `company`,
    `title`,
    `email_notifications`,
    `last_access_on`,
    `last_page`,
    `external_id`,
    `theme`,
    `2fa_secret`,
    `password_reset_token`
)
VALUES
(
    2
    'active'
    3
    'test'
    'test'
    '[email protected]'
    NULL
    '1LfDSHUWkA6WLvR7QscmtYvH'
    'UTC'
    NULL
    NULL
    NULL
    NULL
    NULL
    1
    '2020-09-07 21:05:20'
    '/_/collections/anlage'
    '6948fd8a-cfe7-44f8-9861-6ee195823fbc'
    'auto'
    NULL
    NULL
);

directus-keycloak's People

Contributors

jo-m avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

leevydanomalik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.