This section will cover setting up Keycloak to use with EcoSys Smart API, REST OAuth and/or EcoSys Connect. After completing these steps, you can use the following values in your EcoSys/Connect environments.
-
Base URL
-
Token URL
-
Issuer URL
-
Client ID
-
Client Secret
-
Scope
-
JWKS URL
Follow the steps below:
-
Login to Keycloak as an admin.
-
By default Keycloak comes with a master realm. You can use the existing master Realm or can create a new one.
-
Ensure that the realm being used has Require SSL set to external requests by changing to the realm and navigating to the Login tab.
-
-
Create a new Client Scope.
-
Select Client Scopes.
-
Click the Create button.
-
Enter a Name.
This value is the Client Scope and will be used later during the setup.
-
Click Save
-
-
Create a new Client.
-
Go to Clients and click the Create button
-
Enter the Client ID
This value is the Client ID and will be used later during the setup
-
Set Client Protocol to ‘openid-connect’
-
Set Root URL to your EcoSys URL
-
Click Save
-
Change Access type to Confidential
-
Set Standard Flow Enabled to OFF.
-
For SMART API and REST OAuth usage, set Service Accounts Enabled to ON.
-
Click Save.
-
Click the Credentials tab.
The value from the Secret field is the Client Secret and will be used later in the EcoSys setup.
-
Click the Client Scopes tab.
The newly created client scope appears under Available Client Scopes list. Select the scope and then select Add Selected to add it to the Assigned Default Client Scope list.
-
-
Keycloak uses the default Service Account under Clients to make a request. You must create the same user (Custom) in Ecosys. This is applicable while using Smart APIs or REST OAuth APIs.
If multiple users need SMART API/REST OAuth API access, create a different client for each user.
In EcoSys, go to Admin > Users and Security and create a Custom user with “service-account-ecosys” as Login Name.
-
Keycloak has been configured for Smart API or EcoSys Connect. The required URLS are:
-
JWKS URL = http://<Keycloak Host>:<port>/auth/realms/<Keycloak Realm> /protocol/openid-connect/certs
-
Token URL = http://<Keycloak Host>:<port>/auth/realms/<Keycloak Realm> /protocol/openid-connect/token
-
Base URL/Issuer URL = http://<Keycloak Host>:<port>/auth/realms/<Keycloak Realm>
-