Skip to content

🔐 OIDC Authentication

SSO via OpenID Connect. Users log in with their existing identity provider.

Setup

Go to SettingsAuthenticationAdd Provider.

Add OIDC Provider

FieldDescription
Display NameShown on login button
Issuer URLIdP's discovery URL
Client IDFrom your IdP
Client SecretFrom your IdP
Redirect URICopy this to your IdP
ScopeUsually openid profile

Provider Setup

Microsoft Entra ID (Azure AD)

  1. Azure PortalMicrosoft Entra IDApp registrationsNew registration
  2. Add redirect URI: https://nexterm.yourdomain.com/api/auth/oidc/callback
  3. Copy Application (client) ID → Client ID
  4. Certificates & secretsNew client secret → copy value → Client Secret
  5. Issuer URL: https://login.microsoftonline.com/{tenant-id}/v2.0

Google

  1. Google Cloud ConsoleAPIs & ServicesCredentials
  2. Create CredentialsOAuth client IDWeb application
  3. Add redirect URI: https://nexterm.yourdomain.com/api/auth/oidc/callback
  4. Issuer URL: https://accounts.google.com

WARNING

Google requires app verification for production. Add test users in OAuth consent screen during dev.

Keycloak

  1. ClientsCreate client
  2. Enable Client authentication
  3. Add redirect URI, copy Client Secret from Credentials tab
  4. Issuer URL: https://keycloak.yourdomain.com/realms/{realm-name}

Authentik

  1. ApplicationsProvidersCreateOAuth2/OpenID Provider
  2. Set redirect URI, copy Client ID/Secret
  3. Issuer URL: https://authentik.yourdomain.com/application/o/{application-slug}/

TIP

The trailing slash matters. Check /.well-known/openid-configuration to see the exact issuer value.

Authelia

yaml
identity_providers:
  oidc:
    clients:
      - client_id: nexterm
        client_secret: '$pbkdf2-sha512$your-hashed-secret'
        redirect_uris:
          - https://nexterm.yourdomain.com/api/auth/oidc/callback
        scopes: [ openid, profile, email ]

Issuer URL: https://auth.yourdomain.com

Attribute Mapping

Defaults in Advanced Settings:

FieldClaim
Usernamepreferred_username
First Namegiven_name
Last Namefamily_name

Troubleshooting

Redirect URI mismatch - Must match exactly. Check trailing slashes, http vs https.

User attributes wrong - Check claim names in your IdP's token and adjust mapping.

Distributed under the MIT License