Oauth2
This section will guide you through the configuration of a generic Oauth2 authentication provider, using OpenID Connect.
The provider will use the Oauth2 endpoint to authenticate users; users and groups must exist, and can be fetched using one of the other integrations proposed.
Authentication Provider
To configure the Oauth2 authentication provider, you need to provide the following configuration:
# inside your values.yaml
ui:
appConfig:
# ... other configurations ...
auth:
session:
secret: <secret>
providers:
oidc:
default:
clientId: <clientId>
clientSecret: <clientSecret>
metadataUrl: <metadataUrl>
scope: openid #Optional
prompt: auto
signIn:
resolvers:
- resolver: emailMatchingUserEntityProfileEmail
where:
secretis a unique string that will act as a session secret. There are no constraint on this value, but using a secret that cannot be guessed will reduce the ability to hijack a session to only guessing the session ID. You can configure this as an environment variable or reading it from a secret manager.clientIdis the client ID of the Oauth2 application.clientSecretis the client secret of the Oauth2 application.metadataUrlis the URL of the OpenID Connect metadata, usually it should point to the published .well-known endpoint.callbackUrl(Optional) is the URL where the Oauth2 provider will redirect the user after the authentication process.scope(Optional) is a list of scopes requested to the application. It is a string with space-separated values.promptshould always be set toautoto show the end user the login window.
With this basic configuration (emailMatchingUserEntityProfileEmail), users are resolved by matching their email against the users loaded into Witboost by the chosen Organization Provider. If you need to customize the way users are resolved, you can remove the whole signIn section and add a custom logIn one, like:
# inside your values.yaml
ui:
appConfig:
# ... other configurations ...
auth:
providers:
oidc:
default:
clientId: <clientId>
clientSecret: <clientSecret>
metadataUrl: <metadataUrl>
scope: openid #Optional
prompt: auto
logIn:
user:
annotation: 'microsoft.com/email'
profile:
attribute: 'result.fullProfile.userinfo.email'
In the example above, the user section is used to define the user entity as saved inside Witboost, while the profile section is used to define the profile entity fetched from the provider; in this case, the user is resolved by matching the userinfo.email returned by OpenId COnnect, against the entity annotation microsoft.com/email.
You can change the profile's attribute to match the one returned by the provider, and you can use two different values for the Witboost user:
annotationto match any of the user entity annotations (likemicrosoft.com/email,backstage.io/ldap-rdn, etc.)attributeto match any of the user entity attributes (likemetadata.name,spec.profile.email, etc.)