How-to guide · for Administrators
Sign in with Keycloak
Run Keycloak next to Proxus with the ready profile, keep your people and groups in it, and let them sign in to Proxus with one company account.
At the end of this guide, Keycloak runs next to Proxus, you manage people and their groups in it, and people sign in to Proxus with their Keycloak account. The groups decide their Proxus roles. You need no Active Directory and no internet access.
Keycloak is open-source identity software. Use it when you want one account for Proxus and your other applications (single sign-on), multi-factor sign-in and password rules in one place, or a place to connect Active Directory later.
Before you start
- Proxus installed with the installer.
- Two addresses people can open: one for Proxus, for example
https://proxus.plant.local, and one for Keycloak, for examplehttps://sso.plant.local. In a lab,http://<host>:8080andhttp://<host>:8180are enough. - Both addresses must also be reachable from the Proxus container.
Step 1: Add Keycloak with the installer
- In the folder that contains
proxus-platform, run the installer again (the same command as for the installation) and choose Add Keycloak (single sign-on). On a new installation, answeryto Install Keycloak next to Proxus? instead. - Answer its questions:
- Address people open Proxus with, for example
https://proxus.plant.local. - Address people open Keycloak with, for example
https://sso.plant.local. - Text of the sign-in button, for example
Company account.
- Address people open Proxus with, for example
- The installer creates Keycloak's administrator password and the secret Proxus and Keycloak share, starts Keycloak next to Proxus and connects Proxus to it. At the end it shows the address of Keycloak's administration and the
adminpassword. Both are also inproxus-platform/.env.
At the first start, Keycloak creates its own database on the Proxus PostgreSQL server and a realm called proxus with:
- the application
proxus-hubthat Proxus signs in with, - the groups
proxus-admins,proxus-operatorsandproxus-viewers, - the
groupsinformation Proxus reads to give roles.
Later starts and updates keep what you changed in Keycloak; the realm is not created again. Keycloak's data is in the Proxus database, so the installer's backups include it. To remove Keycloak, run the installer and choose Remove Keycloak; its data stays, so adding it again brings it back.
Step 2: Add people
- Open
<KEYCLOAK_URL>/adminand sign in asadminwithKEYCLOAK_ADMIN_PASSWORD. Switch to the realm proxus (top left). - Open Users and select Add user. Enter the Username, the email and the name, then Create.
- On the Credentials tab, select Set password. Leave Temporary on: the person chooses their own password at the first sign-in.
- On the Groups tab, select Join Group and pick
proxus-operators, for example.
The groups map to Proxus roles in docker-compose.keycloak.yml:
| Keycloak group | Proxus role |
|---|---|
proxus-admins | Administrators |
proxus-operators | Operator |
proxus-viewers | Viewer |
Every user also gets Default when Proxus creates them. To map other groups, add them in proxus-platform/docker-compose.override.yml (updates replace docker-compose.keycloak.yml, never the override), then run docker compose up -d in that folder:
services:
proxus-ui:
environment:
Authentication__Oidc__Providers__0__RoleMap__line-1-operators__0: OperatorStep 3: Test it
- Open Proxus in a private browser window. Under Log In there is now Log In with Company account.
- Select it. Keycloak's sign-in page opens; sign in with the person's user name and password.
- Proxus opens. As an administrator, open Security > Users: the person is listed with Operator and Default, and Sign-in says Single sign-on (company).
Take the person out of the group in Keycloak and sign in again: the role is gone. See Single sign-on for how roles are kept in line.
Turn on what Keycloak adds
| What | Where in Keycloak (realm proxus) |
|---|---|
| Multi-factor sign-in (authenticator app) | Authentication > Required actions: turn on Configure OTP, or add OTP to the browser flow |
| Password rules | Authentication > Policies > Password policy |
| Account locking after wrong passwords | Realm settings > Security defenses > Brute force detection |
| Active Directory or LDAP accounts | User federation, see Active Directory through Keycloak |
Keep a way in
Keep at least one Proxus administrator who signs in with a Proxus password (the Admin user, with two-step verification). When Keycloak cannot be reached, that account still works.
When something does not work
| What you see | Why | What to do |
|---|---|---|
| No Log In with Company account button. | The provider settings are incomplete. | The hub log (category Authentication) names the problem at start. |
| The button shows an error instead of Keycloak's sign-in page. | Proxus cannot reach Keycloak's address. | KEYCLOAK_URL must be reachable from the Proxus container as well as from browsers. |
| Keycloak says "Invalid redirect uri". | The Proxus address you gave is not the one people open Proxus with. | Run the installer, remove and add Keycloak with the right address. The realm reads it only at its first start: change Valid redirect URIs of the client proxus-hub in Keycloak too. |
| Sign-in works but the person has no Proxus role. | The person is in no mapped group. | Add them to a group on the Groups tab, or map their group in the override file. |
| Keycloak shows "HTTPS required". | Keycloak runs on plain HTTP and is opened from an address outside the local network. | Put Keycloak behind HTTPS. In a lab only: Realm settings > General > Require SSL: none. |
What's next
- Choose how people sign in
- Single sign-on: all OpenID Connect settings, API and service accounts
- Active Directory through Keycloak
Was this page helpful?
Evaluating Proxus? See it on your own machines in a 30-minute technical session.