Skip to content

Commit 7dc36d6

Browse files
authored
Merge pull request #60 from Ricardo-Osorio/oidc-with-keycloak
Add page to help setup OIDC with keycloak
2 parents 1fafa39 + 24ca1f6 commit 7dc36d6

6 files changed

Lines changed: 79 additions & 36 deletions

File tree

docs/Getting-Started/OIDC-Setup.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
OpenID Connect (OIDC) allows you to authenticate to RomM using external identity providers, enabling Single Sign-On (SSO) and centralized user management. This setup eliminates the need to manage separate credentials for RomM.
44

5-
## What is OIDC?
5+
## What is OAuth2?
66

7-
OIDC is an identity layer built on top of OAuth2. While OAuth2 primarily handles authorization, OIDC adds authentication, enabling applications to verify a user's identity and obtain profile information. This makes OIDC suitable for SSO solutions, where user identity is central to access management.
7+
OAuth2 (Open Authorization 2.0) is an industry-standard protocol for authorization. It allows applications (clients) to gain limited access to user accounts on an HTTP service without sharing the user’s credentials. Instead, it uses access tokens to facilitate secure interactions. OAuth2 is commonly used in scenarios where users need to authenticate via a third-party service.
8+
9+
## What is OpenID Connect (OIDC)?
10+
11+
OIDC (OpenID Connect) is an identity layer built on top of OAuth2. While OAuth2 primarily handles authorization, OIDC adds authentication, enabling applications to verify a user’s identity and obtain profile information. This makes OIDC suitable for SSO solutions, where user identity is central to access management.
812

913
## How It Works
1014

@@ -33,6 +37,10 @@ A simple OIDC provider that exclusively supports passkey authentication - no pas
3337

3438
An enterprise-grade, open-source identity and access management platform supporting OAuth2, OIDC, SAML, and passwordless authentication.
3539

40+
### [Keycloak](../OIDC-Guides/OIDC-Setup-With-Keycloak.md)
41+
42+
A popular open-source OIDC provider with extensive features for identity and access management.
43+
3644
## General Setup Requirements
3745

3846
Regardless of which provider you choose, you'll need to configure these environment variables in RomM:

docs/OIDC-Guides/OIDC-Setup-With-Authelia.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
Authelia is an open-source authentication and authorization server providing two-factor authentication and single sign-on (SSO) for your applications via a web portal. It acts as a companion for reverse proxies by allowing, denying, or redirecting requests. Authelia can be deployed alongside your other services to centralize identity management.
88

9-
### What is OAuth2?
10-
11-
OAuth2 (Open Authorization 2.0) is an industry-standard protocol for authorization. It allows applications (clients) to gain limited access to user accounts on an HTTP service without sharing the user’s credentials. Instead, it uses access tokens to facilitate secure interactions. OAuth2 is commonly used in scenarios where users need to authenticate via a third-party service.
12-
13-
### What is OpenID Connect (OIDC)?
14-
15-
OIDC (OpenID Connect) is an identity layer built on top of OAuth2. While OAuth2 primarily handles authorization, OIDC adds authentication, enabling applications to verify a user’s identity and obtain profile information. This makes OIDC suitable for SSO solutions, where user identity is central to access management.
16-
179
## Setting up a Provider and Application in Authelia
1810

1911
### Step 1: Install and Configure Authelia

docs/OIDC-Guides/OIDC-Setup-With-Authentik.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
Authentik is an open-source identity provider (IdP) designed to manage authentication, authorization, and user management across applications. It supports modern authentication protocols and provides tools to simplify integration, including single sign-on (SSO), multi-factor authentication (MFA), and auditing capabilities. Authentik can be deployed alongside your other services to centralize identity management.
88

9-
### What is OAuth2?
10-
11-
OAuth2 (Open Authorization 2.0) is an industry-standard protocol for authorization. It allows applications (clients) to gain limited access to user accounts on an HTTP service without sharing the user’s credentials. Instead, it uses access tokens to facilitate secure interactions. OAuth2 is commonly used in scenarios where users need to authenticate via a third-party service.
12-
13-
### What is OpenID Connect (OIDC)?
14-
15-
OIDC (OpenID Connect) is an identity layer built on top of OAuth2. While OAuth2 primarily handles authorization, OIDC adds authentication, enabling applications to verify a user’s identity and obtain profile information. This makes OIDC suitable for SSO solutions, where user identity is central to access management.
16-
179
## Setting up a Provider and Application in Authentik
1810

1911
### Step 1: Install and Configure Authentik
@@ -28,7 +20,7 @@ Before setting up a provider and app, ensure that Authentik is installed and run
2820

2921
### Step 2: Create a Property Mapping
3022

31-
In version 2025.10 Authentik changed their default value for the `email_verified` field from true to false.
23+
In version 2025.10 Authentik changed their default value for the `email_verified` field from true to false.
3224
Since RomM requires a verified email address, without this property, the authentication would fail.
3325

3426
1. **Navigate to Property Mappings**
@@ -44,7 +36,7 @@ Since RomM requires a verified email address, without this property, the authent
4436
"email_verified": True,
4537
}
4638
```
47-
- It should look like this
39+
- It should look like this
4840
![Propperty Mapping](../resources/authentik/propperty-mapping.png)
4941
3. **Click Create**.
5042

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# OIDC Setup With Keycloak
2+
3+
## A quick rundown of the technologies
4+
5+
### What is Keycloak?
6+
7+
Keycloak is an open-source Identity and Access Management solution that provides single sign-on (SSO), OpenID Connect (OIDC), OAuth2, amongst other protocols.
8+
9+
## Setting up a Provider and Application in Keycloak
10+
11+
### Step 1: Install or access Keycloak
12+
13+
Before setting up the OIDC client, ensure that Keycloak is installed and running by following the [setup guide](https://www.keycloak.org/getting-started).
14+
15+
Log into the Admin Console and either create a new realm for RomM or reuse an existing one.
16+
17+
### Step 2: Add a client
18+
19+
1. In the Admin Console select your realm → **Clients****Create client**.
20+
2. Leave `Client type` as `OpenID Connect` and enter a `Client ID` (for example `romm`). Click **Next**.
21+
3. On the next page:
22+
- Enable **Client authentication**.
23+
- Leave only the **Standard flow** option enabled.
24+
- Click **Next**.
25+
4. Set the following URLs:
26+
- **Root URL**: `http://romm.host.local` (replace with your RomM URL)
27+
- **Valid Redirect URIs**: `http://romm.host.local/api/oauth/openid` (replace with your RomM URL)
28+
- **Web origins**: `http://romm.host.local` (replace with your RomM URL)
29+
5. Go to the **Credentials** tab and copy the **Client Secret** — you'll need this for the RomM configuration.
30+
31+
### Step 3: Configure RomM Environment Variables
32+
33+
To enable OIDC authentication in RomM, you need to set the following environment variables:
34+
35+
- `OIDC_ENABLED`: Set to `true` to enable OIDC authentication.
36+
- `OIDC_PROVIDER`: The lowercase name of the provider (`keycloak`).
37+
- `OIDC_CLIENT_ID`: The client ID copied from the Keycloak application.
38+
- `OIDC_CLIENT_SECRET`: The generated output from `Random Password`.
39+
- `OIDC_REDIRECT_URI`: The redirect URI configured in the Keycloak provider, in the format `http://romm.host.local/api/oauth/openid`.
40+
- `OIDC_SERVER_APPLICATION_URL`: The base URL for you Keycloak instance including the realm name, e.g. `http://keycloak.host.local/realms/<realm-name>`.
41+
42+
### Step 5: Set your Email in RomM
43+
44+
In RomM, open your user profile and set your email address. This email **has to match** your user email in Keycloak.
45+
46+
Open the Keycloak Admin Console → Users and mark each RomM user's email as verified. Users without verified emails will not be able to log in.
47+
48+
### Step 6: Test the Integration
49+
50+
After configuring the environment variables, restart (or stop and remove) your RomM instance and navigate to the login page. You should see the option "LOGIN WITH KEYCLOAK". Click on it and you'll be redirected to Keycloak for authentication. Once authenticated, you'll be redirected back to RomM.
51+
52+
Note that if the user already exists in RomM, they will be logged in with their existing account and permissions. If it's a new user, an account will be created for them with viewer permissions by default. To change the permissions for new users, see Step 8 below.
53+
54+
### Step 7: (Optional) Disable password logins
55+
56+
If you want to enforce OIDC logins and disable password-based logins, set the environment variable `PASSWORD_AUTH_ENABLED` to `false`. This will hide the password login option on the login page, ensuring that all users must authenticate via Keycloak.
57+
58+
### Step 8: (Optional) Configure permissions for new users
59+
60+
By default, new users logging in via OIDC will be created with viewer permissions. If you want to change this default behavior, you can set the environment variables:
61+
62+
- `OIDC_CLAIM_ROLES`: Set to the name of the claim that contains the user's role
63+
- `OIDC_ROLE_VIEWER`: The value of the role claim that maps to viewer permissions
64+
- `OIDC_ROLE_EDITOR`: The value of the role claim that maps to editor permissions
65+
- `OIDC_ROLE_ADMIN`: The value of the role claim that maps to admin permissions
66+
67+
Configure Keycloak to include the appropriate role claim in the token

docs/OIDC-Guides/OIDC-Setup-With-PocketID.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ The goal of Pocket ID is to be a simple and easy-to-use. There are other self-ho
1010

1111
Additionally, what makes Pocket ID special is that it only supports passkey authentication, which means you don’t need a password.
1212

13-
### What is OAuth2?
14-
15-
OAuth2 (Open Authorization 2.0) is an industry-standard protocol for authorization. It allows applications (clients) to gain limited access to user accounts on an HTTP service without sharing the user’s credentials. Instead, it uses access tokens to facilitate secure interactions. OAuth2 is commonly used in scenarios where users need to authenticate via a third-party service.
16-
17-
### What is OpenID Connect (OIDC)?
18-
19-
OIDC (OpenID Connect) is an identity layer built on top of OAuth2. While OAuth2 primarily handles authorization, OIDC adds authentication, enabling applications to verify a user’s identity and obtain profile information. This makes OIDC suitable for SSO solutions, where user identity is central to access management.
20-
2113
## Setting up a client in Pocket ID
2214

2315
### Step 1: Install and Configure Pocket ID

docs/OIDC-Guides/OIDC-Setup-With-Zitadel.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
Zitadel is an enterprise-grade, open-source identity and access management (IAM) platform that supports OAuth2, OpenID Connect, SAML, and passwordless authentication. It's used to manage users, roles, and secure login for web and cloud applications.
88

9-
### What is OAuth2?
10-
11-
OAuth2 (Open Authorization 2.0) is an industry-standard protocol for authorization. It allows applications (clients) to gain limited access to user accounts on an HTTP service without sharing the user’s credentials. Instead, it uses access tokens to facilitate secure interactions. OAuth2 is commonly used in scenarios where users need to authenticate via a third-party service.
12-
13-
### What is OpenID Connect (OIDC)?
14-
15-
OIDC (OpenID Connect) is an identity layer built on top of OAuth2. While OAuth2 primarily handles authorization, OIDC adds authentication, enabling applications to verify a user’s identity and obtain profile information. This makes OIDC suitable for SSO solutions, where user identity is central to access management.
16-
179
## Setting up a client in Zitadel
1810

1911
### Step 1: Install and Configure Zitadel

0 commit comments

Comments
 (0)