Skip to content

Build your personal knowledge base with Trilium Notes

docs(user): add information about PocketID & Kanidm

Elian Doran15ae03fba799
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.html
index f495d7050a..a3c0bf0ba2 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.html
@@ -15,10 +15,9 @@
</ol>
<h3>Configuring the authentication provider</h3>
<ol>
- <li>
- <p>First, make sure the authentication provider (e.g. Google, Authelia) is
- configured properly. See&nbsp;<a class="reference-link" href="#root/_help_IgkTHSaFfq6A">Setting up with various providers</a>&nbsp;for
- concrete examples.</p>
+ <li>First, make sure the authentication provider (e.g. Google, Authelia) is
+ configured properly. See&nbsp;<a class="reference-link" href="#root/_help_IgkTHSaFfq6A">Setting up with various providers</a>&nbsp;for
+ concrete examples.
<ol>
<li>The redirect URL of Trilium is <code spellcheck="false">https://&lt;your-trilium-domain&gt;/callback</code>.</li>
<li>You should obtain the base URL, client ID and client secret.</li>
@@ -27,8 +26,14 @@
<li>
<p>Set the following information using&nbsp;<a class="reference-link" href="#root/_help_Gzjqa934BdH4">Configuration (config.ini or environment variables)</a>:</p>
<figure
- class="table">
- <table>
+ class="table" style="width:102.12%;">
+ <table class="ck-table-resized">
+ <colgroup>
+ <col style="width:11.58%;">
+ <col style="width:23.52%;">
+ <col style="width:30.39%;">
+ <col style="width:34.51%;">
+ </colgroup>
<thead>
<tr>
<th>Configuration</th>
@@ -73,6 +78,21 @@
spellcheck="false">client_secret_post</code>. Empty auto-detects. &nbsp;Only needed if sign-in
fails with a <code spellcheck="false">WWW-Authenticate</code> or <code spellcheck="false">invalid_client</code> error.</td>
</tr>
+ <tr>
+ <td>ID token algorithm</td>
+ <td><code spellcheck="false">oauthIdTokenSigningAlg</code>
+ </td>
+ <td><code spellcheck="false">TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHIDTOKENSIGNINGALG</code>
+ </td>
+ <td><span style="color:rgb(32,32,32);">The algorithm your provider signs ID tokens with, e.g. </span>
+ <code
+ spellcheck="false">RS256</code><span style="color:rgb(32,32,32);">, </span><code spellcheck="false">EdDSA</code>
+ <span
+ style="color:rgb(32,32,32);">,</span><code spellcheck="false">ES256</code><span style="color:rgb(32,32,32);">. Empty auto-detects from the provider. Only needed if sign-in fails with an </span>
+ <code
+ spellcheck="false">unexpected JWT alg</code><span style="color:rgb(32,32,32);"> error.</span>
+ </td>
+ </tr>
</tbody>
</table>
</figure>
@@ -85,8 +105,15 @@
spellcheck="false">oauthIssuerName</code>, and <code spellcheck="false">oauthIssuerIcon</code> in
the <code spellcheck="false">config.ini</code> file. Alternatively, these
values can be set using environment variables:</p>
- <figure class="table">
- <table>
+ <figure class="table"
+ style="width:102.11%;">
+ <table class="ck-table-resized">
+ <colgroup>
+ <col style="width:11.57%;">
+ <col style="width:23.5%;">
+ <col style="width:31.17%;">
+ <col style="width:33.76%;">
+ </colgroup>
<thead>
<tr>
<th>Configuration</th>
@@ -102,7 +129,21 @@
</td>
<td><code spellcheck="false">TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL</code>
</td>
- <td>The URL of your provider (e.g. <code spellcheck="false">https://auth.example.com:9091</code>)</td>
+ <td>
+ <p>Either the issuer itself (<code spellcheck="false">https://auth.example.com</code>)
+ or a full discovery URL (<code spellcheck="false">https://auth.example.com/.well-known/openid-configuration</code>).</p>
+ <p>&nbsp;</p>
+ <p>A URL containing <code spellcheck="false">/.well-known/</code> is used as-is
+ <span
+ style="color:rgb(32,32,32);">, which is convenient when your provider hands you a discovery URL to
+ copy. A trailing slash may be included or omitted; Trilium matches whichever
+ spelling the provider advertises.</span>
+ </p>
+ <p>&nbsp;</p>
+ <p>Use the full form when your provider advertises an issuer that differs
+ from the path serving its discovery document, such as Authentik in "global"
+ issuer mode.</p>
+ </td>
</tr>
<tr>
<td>Issuer name</td>
@@ -127,9 +168,7 @@
</figure>
<p>All the fields here are optional, since the default OAuth issuer is Google.</p>
</li>
- <li>
- <p>Restart the server so that the changes are applied.</p>
- </li>
+ <li>Restart the server so that the changes are applied.</li>
</ol>
<aside class="admonition note">
<p>Legacy environment variables are also supported: <code spellcheck="false">TRILIUM_OAUTH_BASE_URL</code>,
@@ -139,7 +178,7 @@
<code
spellcheck="false">TRILIUM_OAUTH_ISSUER_NAME</code>, <code spellcheck="false">TRILIUM_OAUTH_ISSUER_ICON</code>,
<code
- spellcheck="false">TRILIUM_OAUTH_CLIENT_AUTH_METHOD</code>.</p>
+ spellcheck="false">TRILIUM_OAUTH_CLIENT_AUTH_METHOD</code>, <code spellcheck="false">TRILIUM_OAUTH_ID_TOKEN_SIGNING_ALG </code>.</p>
</aside>
<h2>Connecting to the authentication provider</h2>
<p>Once the server has been configured at the previous step, the next step
@@ -211,6 +250,18 @@
class="reference-link" href="#root/_help_ud6MShXL4WpO">Nginx</a>: </p><pre><code class="language-text-x-trilium-auto">proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;</code></pre>
+<h3>Setup fails with an <code spellcheck="false">unexpected JWT alg</code> error</h3>
+<p>Depending on your version the message reads <code spellcheck="false">unexpected JWT "alg" header parameter</code> or
+ <code
+ spellcheck="false">unexpected JWT alg received, expected RS256, got: EdDSA</code>. Both mean
+ the same thing: your provider signs ID tokens with an algorithm other than
+ RS256. Pocket ID (Ed25519) and Kanidm (ES256) do this.</p>
+<p>From v0.104.2 Trilium detects the algorithm from your provider automatically,
+ and the log records the outcome (<code spellcheck="false">OAuth: the issuer does not sign ID tokens with RS256; expecting ES256</code>).
+ If detection can't reach the provider it falls back to RS256, so check
+ that the issuer URL is correct and reachable first. Should it still fail,
+ set <code spellcheck="false">oauthIdTokenSigningAlg</code> explicitly to
+ the algorithm your provider uses.</p>
<h3>Setup fails with <code spellcheck="false">OAUTH_RESPONSE_IS_NOT_CONFORM</code></h3>
<p>Make sure the base URL is correct and that the identity provider actually
supports OpenID Connect. Some providers such as GitHub offer only OAuth
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.html
index 676b866c1b..7f9a66b395 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.html
@@ -1,7 +1,7 @@
<aside class="admonition note">
<p>This page contains instructions on how to set up&nbsp;<a class="reference-link"
href="#root/_help_x1lQNKQBqLcA">Signing in with OpenID Connect</a>&nbsp;with
- various providers such as Authelia, GitLab,. Google. Note that while the
+ various providers such as Authelia, GitLab, Google. Note that while the
configuration reference is correct and up to date, the steps to create
the OAuth application might differ slightly as providers change their UI.</p>
</aside>
@@ -35,9 +35,7 @@
<p>Unlike GitLab, <code spellcheck="false">client_id</code> is a name you choose
rather than one the provider generates.</p>
</li>
- <li>
- <p>Restart Authelia.</p>
- </li>
+ <li>Restart Authelia.</li>
</ol>
<p>Adjust <code spellcheck="false">config.ini</code>, using the <code spellcheck="false">Random Password</code> from
step 1:</p><pre><code class="language-text-x-trilium-auto">[MultiFactorAuthentication]
@@ -90,6 +88,83 @@ oauthClientAuthMethod=client_secret_post
Trilium applies this automatically for <code spellcheck="false">gitlab.com</code>,
but a self-hosted issuer URL cannot be detected.</p>
</aside>
+<h2>Kanidm</h2>
+<ol>
+ <li>
+ <p>Create the client, add the redirect URL and grant the scopes, replacing
+ <code
+ spellcheck="false">&lt;server&gt;</code>with the URL of your Trilium instance and <code spellcheck="false">&lt;group&gt;</code> with
+ an existing Kanidm group whose members may sign in:</p><pre><code class="language-text-x-trilium-auto">kanidm system oauth2 create trilium "Trilium" "https://&lt;server&gt;"
+kanidm system oauth2 add-redirect-url trilium "https://&lt;server&gt;/callback"
+kanidm system oauth2 update-scope-map trilium &lt;group&gt; openid profile email</code></pre>
+ <p>The <code spellcheck="false">openid</code> scope is mandatory; without it
+ Kanidm treats the client as plain OAuth 2.0.</p>
+ </li>
+ <li>
+ <p>Read the client secret:</p><pre><code class="language-text-x-trilium-auto">kanidm system oauth2 show-basic-secret trilium</code></pre>
+ </li>
+</ol>
+<p>Adjust <code spellcheck="false">config.ini</code> as follows, replacing
+ <code
+ spellcheck="false">&lt;idm&gt;</code>with the URL of your Kanidm instance and <code spellcheck="false">&lt;BasicSecret&gt;</code> with
+ the value from step 2:</p><pre><code class="language-text-x-trilium-auto">[MultiFactorAuthentication]
+
+oauthBaseUrl=https://&lt;server&gt;
+
+oauthClientId=trilium
+
+oauthClientSecret=&lt;BasicSecret&gt;
+
+oauthIssuerBaseUrl=https://&lt;idm&gt;/oauth2/openid/trilium
+
+oauthIssuerName=Kanidm</code></pre>
+<p>The client name you chose in step 1 is both the client ID and the last
+ path segment of the issuer URL, so the two must match.</p>
+<aside class="admonition important">
+ <p>Kanidm signs ID tokens with ES256, not RS256. Trilium detects this from
+ the provider on v0.105.0 and later, so no extra configuration is needed.
+ Do <strong>not</strong> run <code spellcheck="false">kanidm system oauth2 warning-enable-legacy-crypto</code>,
+ it downgrades the client to RS256 and disables ES256 entirely. On older
+ Trilium versions sign-in fails with an <code spellcheck="false">unexpected JWT alg</code> error.</p>
+</aside>
+<h2>Pocket ID</h2>
+<aside class="admonition important">
+ <p>Pocket ID is passwordless, signing in requires a passkey. Register one
+ and confirm you can sign in to Pocket ID itself <em>before</em> switching
+ Trilium over to OpenID Connect, otherwise you may find yourself unable
+ to authenticate at either end.</p>
+</aside>
+<ol>
+ <li>Sign in to Pocket ID as an administrator and go to <em>OIDC Clients</em> → <em>Add OIDC Client</em>.</li>
+ <li>Give it a name (e.g. Trilium).</li>
+ <li>Set <em>Callback URLs</em> to <code spellcheck="false">https://&lt;server&gt;/callback</code>,
+ replacing <code spellcheck="false">&lt;server&gt;</code> with the URL of
+ your Trilium instance.</li>
+ <li>Save, then copy the <em>Client ID</em>, <em>Client Secret</em> and <em>OIDC Discovery URL</em>.</li>
+</ol>
+<p>Adjust <code spellcheck="false">config.ini</code> as follows, using the
+ values from step 4:</p><pre><code class="language-text-x-trilium-auto">[MultiFactorAuthentication]
+
+oauthBaseUrl=https://&lt;server&gt;
+
+oauthClientId=&lt;ClientID&gt;
+
+oauthClientSecret=&lt;ClientSecret&gt;
+
+oauthIssuerBaseUrl=&lt;OIDCDiscoveryURL&gt;
+
+oauthIssuerName=Pocket ID</code></pre>
+<aside class="admonition note">
+ <p>Pocket ID gives you an <em>OIDC Discovery URL</em> ending in <code spellcheck="false">/.well-known/openid-configuration</code>.
+ On v0.105.0 and later you can paste it as-is. On earlier versions, remove
+ that suffix and use only the part before it.</p>
+</aside>
+<aside class="admonition important">
+ <p>Pocket ID generates an RS256 signing key on first start, which works without
+ further configuration. If you rotate it to Ed25519 (<code spellcheck="false">pocket-id key-rotate --alg EdDSA --crv Ed25519</code>),
+ ID tokens are signed with EdDSA instead. Trilium detects this automatically
+ on v0.105.0 and later; older versions fail with <code spellcheck="false">unexpected JWT alg received, expected RS256, got: EdDSA</code>.</p>
+</aside>
<h2>GitHub</h2>
<p>GitHub cannot be used as an identity provider because it is plain OAuth
2.0 and not OpenID Connect, so it will fail with <code spellcheck="false">OAUTH_RESPONSE_IS_NOT_CONFORM</code>.</p>
diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.md
index 15a5889c3a..fc373bda18 100644
--- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.md
+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect.md
@@ -13,7 +13,6 @@ Setting up authentication with OpenID connect is a two-step process:
### Configuring the authentication provider
1. First, make sure the authentication provider (e.g. Google, Authelia) is configured properly. See <a class="reference-link" href="Signing%20in%20with%20OpenID%20Connect/Setting%20up%20with%20various%20providers.md">Setting up with various providers</a> for concrete examples.
-
1. The redirect URL of Trilium is `https://<your-trilium-domain>/callback`.
2. You should obtain the base URL, client ID and client secret.
2. Set the following information using <a class="reference-link" href="../../Advanced%20Usage/Configuration%20(config.ini%20or%20environment%20variables).md">Configuration (config.ini or environment variables)</a>:
@@ -24,13 +23,14 @@ Setting up authentication with OpenID connect is a two-step process:
| Client ID\* | `oauthClientId` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID` | The client ID from your provider configuration. |
| Client Secret\* | `oauthClientSecret` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET` | The client secret from your provider configuration. |
| Client auth method | `oauthClientAuthMethod` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTAUTHMETHOD` | Token-endpoint auth method: `client_secret_basic` or `client_secret_post`. Empty auto-detects.  Only needed if sign-in fails with a `WWW-Authenticate` or `invalid_client` error. |
+ | ID token algorithm | `oauthIdTokenSigningAlg` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHIDTOKENSIGNINGALG` | <span style="color:rgb(32,32,32);">The algorithm your provider signs ID tokens with, e.g.</span> `RS256`<span style="color:rgb(32,32,32);">,</span> `EdDSA`<span style="color:rgb(32,32,32);">,</span> `ES256`<span style="color:rgb(32,32,32);">. Empty auto-detects from the provider. Only needed if sign-in fails with an</span> `unexpected JWT alg` <span style="color:rgb(32,32,32);">error.</span> |
Asterisk (\*) marks a required field
3. The default OAuth issuer is Google. To use other services such as Authentik or Auth0, you can configure the settings via `oauthIssuerBaseUrl`, `oauthIssuerName`, and `oauthIssuerIcon` in the `config.ini` file. Alternatively, these values can be set using environment variables:
| Configuration | `config.ini` in `[MultiFactorAuthentication]` section | Environment variable | Description |
| --- | --- | --- | --- |
- | Issuer base URL | `oauthIssuerBaseUrl` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL` | The URL of your provider (e.g. `https://auth.example.com:9091`) |
+ | Issuer base URL | `oauthIssuerBaseUrl` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL` | Either the issuer itself (`https://auth.example.com`) or a full discovery URL (`https://auth.example.com/.well-known/openid-configuration`).<br><br>A URL containing `/.well-known/` is used as-is<span style="color:rgb(32,32,32);">, which is convenient when your provider hands you a discovery URL to copy. A trailing slash may be included or omitted; Trilium matches whichever spelling the provider advertises.</span><br><br>Use the full form when your provider advertises an issuer that differs from the path serving its discovery document, such as Authentik in "global" issuer mode. |
| Issuer name | `oauthIssuerName` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME` | The name of your authentication provider, used for reference on the login screen and in settings. Default is “Google”. |
| Issuer icon | `oauthIssuerIcon` | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON` | Optionally, the URL to a logo of the provider. By default it will try to obtain the favicon from the website, so it's optional. |
@@ -38,7 +38,7 @@ Setting up authentication with OpenID connect is a two-step process:
4. Restart the server so that the changes are applied.
> [!NOTE]
-> Legacy environment variables are also supported: `TRILIUM_OAUTH_BASE_URL`, `TRILIUM_OAUTH_CLIENT_ID`, `TRILIUM_OAUTH_CLIENT_SECRET`, and for customizing the provider: `TRILIUM_OAUTH_ISSUER_BASE_URL`, `TRILIUM_OAUTH_ISSUER_NAME`, `TRILIUM_OAUTH_ISSUER_ICON`, `TRILIUM_OAUTH_CLIENT_AUTH_METHOD`.
+> Legacy environment variables are also supported: `TRILIUM_OAUTH_BASE_URL`, `TRILIUM_OAUTH_CLIENT_ID`, `TRILIUM_OAUTH_CLIENT_SECRET`, and for customizing the provider: `TRILIUM_OAUTH_ISSUER_BASE_URL`, `TRILIUM_OAUTH_ISSUER_NAME`, `TRILIUM_OAUTH_ISSUER_ICON`, `TRILIUM_OAUTH_CLIENT_AUTH_METHOD`, `TRILIUM_OAUTH_ID_TOKEN_SIGNING_ALG` .
## Connecting to the authentication provider
@@ -97,6 +97,12 @@ proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
```
+### Setup fails with an `unexpected JWT alg` error
+
+Depending on your version the message reads `unexpected JWT "alg" header parameter` or `unexpected JWT alg received, expected RS256, got: EdDSA`. Both mean the same thing: your provider signs ID tokens with an algorithm other than RS256. Pocket ID (Ed25519) and Kanidm (ES256) do this.
+
+From v0.104.2 Trilium detects the algorithm from your provider automatically, and the log records the outcome (`OAuth: the issuer does not sign ID tokens with RS256; expecting ES256`). If detection can't reach the provider it falls back to RS256, so check that the issuer URL is correct and reachable first. Should it still fail, set `oauthIdTokenSigningAlg` explicitly to the algorithm your provider uses.
+
### Setup fails with `OAUTH_RESPONSE_IS_NOT_CONFORM`
Make sure the base URL is correct and that the identity provider actually supports OpenID Connect. Some providers such as GitHub offer only OAuth 2.0.
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md
index 3301354dcd..7371c616ef 100644
--- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md
+++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Signing in with OpenID Connect/Setting up with various providers.md
@@ -1,6 +1,6 @@
# Setting up with various providers
> [!NOTE]
-> This page contains instructions on how to set up <a class="reference-link" href="../Signing%20in%20with%20OpenID%20Connect.md">Signing in with OpenID Connect</a> with various providers such as Authelia, GitLab,. Google. Note that while the configuration reference is correct and up to date, the steps to create the OAuth application might differ slightly as providers change their UI.
+> This page contains instructions on how to set up <a class="reference-link" href="../Signing%20in%20with%20OpenID%20Connect.md">Signing in with OpenID Connect</a> with various providers such as Authelia, GitLab, Google. Note that while the configuration reference is correct and up to date, the steps to create the OAuth application might differ slightly as providers change their UI.
## Authelia
@@ -76,6 +76,66 @@ oauthClientAuthMethod=client_secret_post
>
> GitLab's token endpoint does not decode credentials sent via HTTP Basic, so without `oauthClientAuthMethod`, sign-in fails with a `server responded with a challenge in the WWW-Authenticate HTTP Header` error. Trilium applies this automatically for `gitlab.com`, but a self-hosted issuer URL cannot be detected.
+## Kanidm
+
+1. Create the client, add the redirect URL and grant the scopes, replacing `<server>` with the URL of your Trilium instance and `<group>` with an existing Kanidm group whose members may sign in:
+
+ ```
+ kanidm system oauth2 create trilium "Trilium" "https://<server>"
+ kanidm system oauth2 add-redirect-url trilium "https://<server>/callback"
+ kanidm system oauth2 update-scope-map trilium <group> openid profile email
+ ```
+
+ The `openid` scope is mandatory; without it Kanidm treats the client as plain OAuth 2.0.
+2. Read the client secret:
+
+ ```
+ kanidm system oauth2 show-basic-secret trilium
+ ```
+
+Adjust `config.ini` as follows, replacing `<idm>` with the URL of your Kanidm instance and `<BasicSecret>` with the value from step 2:
+
+```
+[MultiFactorAuthentication]
+oauthBaseUrl=https://<server>
+oauthClientId=trilium
+oauthClientSecret=<BasicSecret>
+oauthIssuerBaseUrl=https://<idm>/oauth2/openid/trilium
+oauthIssuerName=Kanidm
+```
+
+The client name you chose in step 1 is both the client ID and the last path segment of the issuer URL, so the two must match.
+
+> [!IMPORTANT]
+> Kanidm signs ID tokens with ES256, not RS256. Trilium detects this from the provider on v0.105.0 and later, so no extra configuration is needed. Do **not** run `kanidm system oauth2 warning-enable-legacy-crypto`, it downgrades the client to RS256 and disables ES256 entirely. On older Trilium versions sign-in fails with an `unexpected JWT alg` error.
+
+## Pocket ID
+
+> [!IMPORTANT]
+> Pocket ID is passwordless, signing in requires a passkey. Register one and confirm you can sign in to Pocket ID itself _before_ switching Trilium over to OpenID Connect, otherwise you may find yourself unable to authenticate at either end.
+
+1. Sign in to Pocket ID as an administrator and go to _OIDC Clients_ → _Add OIDC Client_.
+2. Give it a name (e.g. Trilium).
+3. Set _Callback URLs_ to `https://<server>/callback`, replacing `<server>` with the URL of your Trilium instance.
+4. Save, then copy the _Client ID_, _Client Secret_ and _OIDC Discovery URL_.
+
+Adjust `config.ini` as follows, using the values from step 4:
+
+```
+[MultiFactorAuthentication]
+oauthBaseUrl=https://<server>
+oauthClientId=<ClientID>
+oauthClientSecret=<ClientSecret>
+oauthIssuerBaseUrl=<OIDCDiscoveryURL>
+oauthIssuerName=Pocket ID
+```
+
+> [!NOTE]
+> Pocket ID gives you an _OIDC Discovery URL_ ending in `/.well-known/openid-configuration`. On v0.105.0 and later you can paste it as-is. On earlier versions, remove that suffix and use only the part before it.
+
+> [!IMPORTANT]
+> Pocket ID generates an RS256 signing key on first start, which works without further configuration. If you rotate it to Ed25519 (`pocket-id key-rotate --alg EdDSA --crv Ed25519`), ID tokens are signed with EdDSA instead. Trilium detects this automatically on v0.105.0 and later; older versions fail with `unexpected JWT alg received, expected RS256, got: EdDSA`.
+
## GitHub
GitHub cannot be used as an identity provider because it is plain OAuth 2.0 and not OpenID Connect, so it will fail with `OAUTH_RESPONSE_IS_NOT_CONFORM`.