Skip to content

Commit 499682c

Browse files
docs: add Immich OIDC integration guide (#98)
Co-authored-by: Stavros <steveiliop56@gmail.com>
1 parent fe52184 commit 499682c

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

‎astro.config.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ export default defineConfig({
134134
label: "Zerobyte",
135135
slug: "docs/integrations/zerobyte",
136136
},
137+
{
138+
label: "Immich",
139+
slug: "docs/integrations/immich",
140+
},
137141
],
138142
},
139143
{
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: Immich
3+
description: Use the Tinyauth OpenID Connect provider to authenticate users with Immich.
4+
---
5+
6+
import { Tabs, TabItem } from '@astrojs/starlight/components';
7+
import CreateOidcClientTool from "../../../../components/create-oidc-client-tool.astro";
8+
9+
[Immich](https://immich.app/) is a self-hosted photo and video backup solution. By integrating Tinyauth as an OpenID Connect provider, you can centralize authentication and offer single sign-on (SSO) for your Immich users.
10+
11+
## Requirements
12+
13+
- A running instance of Immich
14+
- A Tinyauth instance
15+
- HTTPS configured for both services
16+
17+
:::caution
18+
You will need to run Tinyauth with HTTPS to use it as an OpenID Connect provider.
19+
:::
20+
21+
## Tinyauth Configuration
22+
23+
First, generate an OIDC client for Immich in Tinyauth:
24+
25+
<Tabs>
26+
<TabItem label="Docker">
27+
```sh
28+
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 oidc create immich
29+
```
30+
</TabItem>
31+
<TabItem label="Binary">
32+
```sh
33+
./tinyauth oidc create immich
34+
```
35+
</TabItem>
36+
<TabItem label="Browser">
37+
<CreateOidcClientTool />
38+
</TabItem>
39+
</Tabs>
40+
41+
From the output, keep the generated client ID and client secret.
42+
43+
Now, configure Tinyauth using environment variables:
44+
45+
```sh
46+
TINYAUTH_OIDC_PRIVATEKEYPATH=/path/to/private/key.pem
47+
TINYAUTH_OIDC_PUBLICKEYPATH=/path/to/public/key.pem
48+
TINYAUTH_OIDC_CLIENTS_IMMICH_CLIENTID=client-id
49+
TINYAUTH_OIDC_CLIENTS_IMMICH_CLIENTSECRET=ta-client-secret
50+
TINYAUTH_OIDC_CLIENTS_IMMICH_TRUSTEDREDIRECTURIS=https://immich.example.com/auth/login,https://immich.example.com/user-settings,https://immich.example.com/api/oauth/mobile-redirect,app.immich:///oauth-callback
51+
TINYAUTH_OIDC_CLIENTS_IMMICH_NAME=Immich
52+
```
53+
54+
:::note
55+
Immich uses multiple redirect URIs depending on your clients:
56+
- Web login: `https://immich.example.com/auth/login`
57+
- Account linking in web UI: `https://immich.example.com/user-settings` - Mobile redirect endpoint: `https://immich.example.com/api/oauth/mobile-redirect` (useful if a custom scheme redirect is rejected)
58+
- Mobile app: `app.immich:///oauth-callback`
59+
:::
60+
61+
Restart your Tinyauth instance after applying the configuration.
62+
63+
## Immich Configuration
64+
65+
In Immich, go to *Administration* -> *Settings* -> *Authentication Settings* and enable OAuth. Use the following values:
66+
67+
| Field | Value |
68+
| - | - |
69+
| Enabled | `true` |
70+
| Issuer URL | Your Tinyauth URL, for example `https://tinyauth.example.com` |
71+
| Client ID | The client ID generated in the previous step |
72+
| Client Secret | The client secret generated in the previous step |
73+
| Scope | `openid email profile` |
74+
| Button Text | Optional, e.g. `Login with Tinyauth` |
75+
| Auto Register | Optional, usually `true` for first login provisioning |
76+
| Auto Launch | Optional, enable only if you want to skip the default Immich login page |
77+
78+
:::note
79+
Immich performs OIDC discovery from the issuer URL. You can provide either:
80+
- `https://tinyauth.example.com`
81+
- `https://tinyauth.example.com/.well-known/openid-configuration`
82+
:::
83+
84+
Save the settings, then open the Immich login page and use the OAuth button to test the flow.
85+
86+
If authentication is successful, users are redirected to Tinyauth to sign in, then are returned to Immich as authenticated users.

0 commit comments

Comments
 (0)