mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:02 -04:00
Authentik OIDC
1. Authentik Application Configuration
Step 1: Log in to the Authentik Admin Interface
- Access the Authentik admin interface (e.g.,
https://auth.example.com/if/admin). - Log in with your admin credentials.
Step 2: Create a Provider
- Go to Providers in the left-hand menu.
- Click Create Provider.
- Choose OAuth2/OpenID Connect Provider as the provider type.
- Set the following fields:
- Name:
unifi-voucher-provider. - Authentication flow:
default-authentication-flow. - Authorization flow:
default-provider-authorization-implicit-consent. - Client Type: Select
confidential, A client secret will be generated.
- Name:
- Set the Redirect URI to match your UniFi Voucher Site’s callback URL (e.g.,
https://voucher.example.com/oidc/callback). - Click Submit.
After saving, note down the Client ID and Client Secret generated for this provider. You’ll need it when configuring your UniFi Voucher Site.
Step 3: Create a New Application
- Go to Applications in the left-hand menu.
- Click Create Application.
- Fill in the following fields:
- Name:
UniFi Voucher(You can choose any relevant name). - Slug: This is a URL-friendly identifier (e.g.,
unifi-voucher). - Provider: Select the provider you created in step 2 (e.g.,
unifi-voucher-provider).
- Name:
- Click Submit to save.
2. UniFi Voucher Site Configuration
Now, configure your UniFi Voucher Site to use the Authentik client.
- In your UniFi Voucher Site configuration, set
AUTH_OIDC_ENABLEDtotrue. - Set the
AUTH_OIDC_CLIENT_IDas configured in Authentik (found in the Authentik provider configuration). - Provide the
AUTH_OIDC_CLIENT_SECRET(found in the Authentik provider configuration). - Provide the
AUTH_OIDC_ISSUER_BASE_URLfrom your Authentik provider.- You can find this under Providers > unifi-voucher-provider > OpenID Configuration URL in Authentik.
- Provide the
AUTH_OIDC_APP_BASE_URLfrom your UniFi Voucher Site instance (e.g.,https://voucher.example.com). - Restart the container after these changes
3. Testing and Troubleshooting
- Test the login flow from your UniFi Voucher Site. Ensure it redirects to Authentik for authentication.
- After logging in, the user should be redirected back to the voucher site with the appropriate tokens.
Common Issues
- Invalid Redirect URI: Ensure the callback URI matches what is configured in Authentik.
- Client Secret Errors: Double-check the client secret in both Authentik and your UniFi configuration.



