A modified version of Wafrn used on https://wf.jbc.lol (mirror of https://git.jbc.lol/jbcrn/wf.jbc.lol which is a mirror of https://codeberg.org/jbcarreon123/wf.jbc.lol)
···5353POSTGRES_METRICS_PASSWORD=
5454POSTGRES_METRICS_DBNAME=pgwatch_metrics
5555GF_SECURITY_ADMIN_PASSWORD=
5656+5757+# OpenID Connect auth
5858+# Only do this if you know what you are doing! See docs/openid.md for more info
5959+OIDC_ENABLED=false
6060+OIDC_ISSUER=https://auth.localhost
6161+OIDC_CLIENT_ID=wafrn
6262+OIDC_CLIENT_SECRET=secret
6363+OIDC_AUTH_NAME=OpenID
+37
docs/openid.md
···11+# Setting up OpenID Connect (OIDC) authentication
22+33+If you are handling multiple services aside from Wafrn, you can implement something called an identity provider (or an IdP) which is a service that provides a central account to log in on multiple services.
44+55+Linking it on Wafrn is possible, if your provider supports the OpenID Connect specification. Implementing this shouldn't have any breaking changes on your instance. Signing up using OpenID is not implemented due to security issues, but it will prefill your email and username on the register screen.
66+77+Here's how you can implement OIDC auth on your instance:
88+99+1. Create a authentication client on your identity provider of choice. I will use Keycloak on this guide but you can use anything else (like Authentik, Authelia, etc).
1010+1111+ 1. Set your client type to OpenID Connect (if possible)
1212+1313+ 2. Set the Client ID to anything you want. Take note of that ID, we will need that later.
1414+1515+ 3. Set the client name to 'Wafrn'. You can change that if you like, that will be the name shown if someone authenticates to your Wafrn instance for the first time. Optionally, set the description of it.
1616+1717+ 4. Enable both client authentication and authorization, and don't touch anything else.
1818+1919+ 5. Set the root URL to your Wafrn instance's homepage (e.g. `https://app.wafrn.net/`), and set the home URL with the same thing.
2020+2121+ 6. Set the redirect URL to `https://wafrn.example/api/login/oidc/callback*`.
2222+2323+ 7. Copy the provided Client secret. We will need that.
2424+2525+2. In your .env file, edit these values:
2626+2727+ - `OIDC_ENABLED` to `true`
2828+2929+ - `OIDC_ISSUER` to your IdP's issuer URL
3030+3131+ - `OIDC_CLIENT_ID` is your specified client ID
3232+3333+ - `OIDC_CLIENT_SECRET` to the provided client secret
3434+3535+ - `OIDC_AUTH_NAME` to the name you want to call your auth provider
3636+3737+3. Now, restart the container. To take effect easily, you should clear your browser local storage by running `localStorage.clear()` in your browser console.