Skip to main content

Keycloak

Setup Configuration#

Assumption:

  1. A working and reachable (from the api server) Keycloak setup
  2. A Realm defined

Create a realm#

note: preferable without spaces

create a client#

Set the Client to confidential so you can get access to the credential tab .

The credential tab provides, client_id and client_secret

You can get the publickey verifier from the Realm settings

Configuring a Group#

Create a "datatrucker group" type key cloak : Sample below

Create a role with same name in keycloak

Add users to the role on keycloak

Note:Important**Create a Keycloak Role ** with the same name as the Group created in Datatrucker , and add the group into the role

Test the users authentication via API to key cloak,#

Configure the crypto.config.json file on the API server#

     "keycloak": {                        "realm" : "trucker",     -----> Realm created            "client_id": "nodejs",       -----> Client created            "url": "http://172.28.24.164:30015",     -----> keycloak URL            "client_secret": "8fa4d2ee-baed-4209-adeb-8926127df2ea",     -----> Realm created            "jwt_publickey_verifier" : "keycloak.key"          -----> Realm created       }

Once the above is configured, start the api server and test the authentication