Integrate with PhotoPrism
Support level: Community
What is PhotoPrism?
PhotoPrism is an AI-powered photos app that lets you browse, organize, and find photos and videos on a home server, private server, or in the cloud.
Preparation
The following placeholders are used in this guide:
photoprism.companyis the FQDN of the PhotoPrism installation.authentik.companyis the FQDN of the authentik installation.
This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.
PhotoPrism requires HTTPS for OpenID Connect (OIDC). Make sure that the PHOTOPRISM_SITE_URL value, the PhotoPrism redirect URI in authentik, and the public URL users use to access PhotoPrism all use the same HTTPS hostname.
authentik configuration
To support the integration of PhotoPrism with authentik, you need to create an application/provider pair in authentik.
Create an application and provider in authentik
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
Navigate to Applications > Applications and click New Application to open the application wizard.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings.
- Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Note the Client ID and Client Secret values because they will be required later.
- Add one
Strictredirect URI and set it tohttps://photoprism.company/api/v1/oidc/redirect. - Select any available signing key.
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's My applications page.
-
Click Submit to save the new application and provider.
PhotoPrism configuration
Configure PhotoPrism with the OIDC settings from authentik. Add the following settings to your PhotoPrism .env file:
PHOTOPRISM_SITE_URL=https://photoprism.company/
PHOTOPRISM_OIDC_URI=https://authentik.company/application/o/<application_slug>/
PHOTOPRISM_OIDC_CLIENT=<Client ID from authentik>
PHOTOPRISM_OIDC_SECRET=<Client Secret from authentik>
PHOTOPRISM_OIDC_SCOPES=openid email profile
PHOTOPRISM_OIDC_PROVIDER=authentik
# Optional: Automatically redirect unauthenticated users to authentik.
PHOTOPRISM_OIDC_REDIRECT=false
# Optional: Allow PhotoPrism to create new accounts from OIDC logins.
PHOTOPRISM_OIDC_REGISTER=true
Restart PhotoPrism after changing these settings.
Configuration verification
To confirm that authentik is properly configured with PhotoPrism, log out of PhotoPrism and log back in using the authentik OIDC login option. You should be redirected to authentik for authentication and then redirected back to PhotoPrism.