Skip to content

Commit 520ab00

Browse files
author
Benno Evers
committed
docs: mention OIDC setup in the README
1 parent b816d94 commit 520ab00

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,50 @@ password can then be changed from the web interface
7373
| `GONIC_MULTI_VALUE_ALBUM_ARTIST` | `-multi-value-album-artist` | **optional** setting for multi-valued album artist tags when scanning ([see more](#multi-valued-tags-v016)) |
7474
| `GONIC_TRANSCODE_CACHE_SIZE` | `-transcode-cache-size` | **optional** size of the transcode cache in MB (0 = no limit) |
7575
| `GONIC_TRANSCODE_EJECT_INTERVAL` | `-transcode-eject-interval` | **optional** interval (in minutes) to eject transcode cache (0 = never) |
76+
| `GONIC_AUTH_METHOD` | `-auth-method` | **optional** authentication method: `password` (default), `oidc`, or `oidc-forward` ([see more](#oidc-authentication)) |
77+
| `GONIC_OIDC_ISSUER_URL` | `-oidc-issuer-url` | **optional** OIDC issuer URL for token authentication ([see more](#oidc-authentication)) |
78+
| `GONIC_OIDC_CLIENT_ID` | `-oidc-client-id` | **optional** OIDC client ID for token validation ([see more](#oidc-authentication)) |
79+
| `GONIC_OIDC_CLIENT_SECRET` | `-oidc-client-secret` | **optional** OIDC client secret for token exchange ([see more](#oidc-authentication)) |
80+
| `GONIC_OIDC_CLIENT_SECRET_FILE` | `-oidc-client-secret-file` | **optional** path to file containing OIDC client secret ([see more](#oidc-authentication)) |
81+
| `GONIC_OIDC_FORWARD_HEADER` | `-oidc-forward-header` | **optional** header name containing OIDC token for oidc-forward method (default: `Authorization`) ([see more](#oidc-authentication)) |
82+
| `GONIC_OIDC_ADMIN_ROLE` | `-oidc-admin-role` | **optional** role name for admin users in OIDC token roles claim (default: `gonic-admin`) ([see more](#oidc-authentication)) |
7683
| `GONIC_EXPVAR` | `-expvar` | **optional** enable the /debug/vars endpoint (exposes useful debugging attributes as well as database stats) |
7784

85+
## oidc authentication
86+
87+
gonic supports OpenID Connect (OIDC) authentication as an alternative to password-based authentication. This allows integration with identity providers like Keycloak, Auth0, Okta, or any OIDC-compliant provider.
88+
89+
### authentication methods
90+
91+
| method | description |
92+
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
93+
| `password` | **default** - traditional username/password authentication |
94+
| `oidc` | full OIDC flow with authorization code exchange - users are redirected to identity provider for login, then redirected back to gonic with an authorization code |
95+
| `oidc-forward` | for use behind an authenticating proxy - expects a valid JWT token in the specified header (useful with [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/) or similar) |
96+
97+
### configuration example
98+
99+
```bash
100+
# basic oidc setup
101+
export GONIC_AUTH_METHOD="oidc"
102+
export GONIC_OIDC_ISSUER_URL="https://your-oidc-provider.com"
103+
export GONIC_OIDC_CLIENT_ID="gonic-client"
104+
export GONIC_OIDC_CLIENT_SECRET="your-client-secret"
105+
106+
# or for proxy-based authentication
107+
export GONIC_AUTH_METHOD="oidc-forward"
108+
export GONIC_OIDC_ISSUER_URL="https://your-oidc-provider.com"
109+
export GONIC_OIDC_FORWARD_HEADER="X-Auth-Credentials" # header containing JWT token
110+
```
111+
112+
### user management
113+
114+
when using OIDC authentication:
115+
116+
- users are automatically created on first login using information from the OIDC token
117+
- admin privileges are determined by the presence of the configured admin role in the token's roles claim
118+
- user information is updated from the token on each login
119+
78120
## multi valued tags (v0.16+)
79121

80122
gonic can support potentially multi valued tags like `genres`, `artists`, and `albumartists`. in both cases gonic will individual entries in its database for each.

0 commit comments

Comments
 (0)