Skip to main content

SSO (Single sign-on)

This reference document describes the available SSO protocols, configuration options, and parameters in Infrahub.

Supported protocols​

info

See Authentication topic for details on the differences between OIDC and OAuth2.

OpenID Connect (OIDC)​

OIDC is an identity layer built on top of OAuth 2.0 that standardizes user authentication and identity information exchange.

OAuth 2.0​

OAuth 2.0 is an industry-standard protocol for authorization that focuses on client developer simplicity.

Configuration slots​

Infrahub provides six predefined configuration slots for identity providers:

ProtocolAvailable Slots
OIDCPROVIDER1, PROVIDER2, GOOGLE
OAuth 2.0PROVIDER1, PROVIDER2, GOOGLE
info

The Google provider configuration is simplified compared to standard providers. It only requires client_id and client_secret parameters, as the other endpoints are pre-configured. Otherwise, the functionality is identical to standard providers.

Configuration parameters​

OIDC parameters​

ParameterEnvironment VariableTOML PathDescriptionRequired
Client IDINFRAHUB_OIDC_<SLOT>_CLIENT_IDsecurity.oidc_provider_settings.<slot>.client_idThe client identifier issued to the client by the identity providerYes
Client SecretINFRAHUB_OIDC_<SLOT>_CLIENT_SECRETsecurity.oidc_provider_settings.<slot>.client_secretThe client secret issued to the client by the identity providerYes
Discovery URLINFRAHUB_OIDC_<SLOT>_DISCOVERY_URLsecurity.oidc_provider_settings.<slot>.discovery_urlThe URL of the OIDC discovery documentYes
Display LabelINFRAHUB_OIDC_<SLOT>_DISPLAY_LABELsecurity.oidc_provider_settings.<slot>.display_labelThe label displayed on the login buttonNo
IconINFRAHUB_OIDC_<SLOT>_ICONsecurity.oidc_provider_settings.<slot>.iconThe Material Design icon name to display on the login buttonNo
Enabled ProvidersINFRAHUB_SECURITY_OIDC_PROVIDERSsecurity.oidc_providersArray of enabled OIDC provider slotsYes*

*At least one provider must be specified if using OIDC.

OAuth 2.0 parameters​

ParameterEnvironment VariableTOML PathDescriptionRequired
Client IDINFRAHUB_OAUTH2_<SLOT>_CLIENT_IDsecurity.oauth2_provider_settings.<slot>.client_idThe client identifier issued to the client by the identity providerYes
Client SecretINFRAHUB_OAUTH2_<SLOT>_CLIENT_SECRETsecurity.oauth2_provider_settings.<slot>.client_secretThe client secret issued to the client by the identity providerYes
Authorization URLINFRAHUB_OAUTH2_<SLOT>_AUTHORIZATION_URLsecurity.oauth2_provider_settings.<slot>.authorization_urlThe authorization endpoint URLYes
Token URLINFRAHUB_OAUTH2_<SLOT>_TOKEN_URLsecurity.oauth2_provider_settings.<slot>.token_urlThe token endpoint URLYes
Userinfo URLINFRAHUB_OAUTH2_<SLOT>_USERINFO_URLsecurity.oauth2_provider_settings.<slot>.userinfo_urlThe userinfo endpoint URLYes
Display LabelINFRAHUB_OAUTH2_<SLOT>_DISPLAY_LABELsecurity.oauth2_provider_settings.<slot>.display_labelThe label displayed on the login buttonNo
IconINFRAHUB_OAUTH2_<SLOT>_ICONsecurity.oauth2_provider_settings.<slot>.iconThe Material Design icon name to display on the login buttonNo
Enabled ProvidersINFRAHUB_SECURITY_OAUTH2_PROVIDERSsecurity.oauth2_providersArray of enabled OAuth 2.0 provider slotsYes*

*At least one provider must be specified if using OAuth 2.0.

Redirect URI formats​

When configuring a provider in an external identity system, use the following format for the redirect URI:

https://<your-infrahub-hostname>/auth/<protocol>/<provider-slot>/callback
ProtocolFormat Example
OIDChttps://infrahub.example.com/auth/oidc/provider1/callback
OAuth 2.0https://infrahub.example.com/auth/oauth2/provider1/callback

User attributes mapping​

Infrahub maps standard profile attributes from identity providers to its internal user model:

Infrahub User FieldOIDC ClaimOAuth 2.0 Field
Usernamepreferred_username or emailpreferred_username or email
Emailemailemail
First Namegiven_namegiven_name
Last Namefamily_namefamily_name

Examples​

OIDC configuration example​

[security.oidc_provider_settings.provider1]
client_id = "client-id-from-idp"
client_secret = "client-secret-from-idp"
discovery_url = "https://login.microsoftonline.com/tenant-id/v2.0/.well-known/openid-configuration"
display_label = "Microsoft Entra ID"
icon = "mdi:microsoft"

[security]
oidc_providers = ["provider1"]

OAuth 2.0 configuration example​

[security.oauth2_provider_settings.provider1]
client_id = "client-id-from-idp"
client_secret = "client-secret-from-idp"
authorization_url = "https://login.microsoftonline.com/tenant-id/oauth2/v2.0/authorize"
token_url = "https://login.microsoftonline.com/tenant-id/oauth2/v2.0/token"
userinfo_url = "https://graph.microsoft.com/oidc/userinfo"
display_label = "Microsoft Entra ID"
icon = "mdi:microsoft"

[security]
oauth2_providers = ["provider1"]