Skip to main content

OIDC Setup

connectCenter can sign users in through an external OpenID Connect (OIDC) provider, configured at install time. This is optional — local accounts work without it — but external add-ons such as the external API rely on JWT validation against an OIDC provider and therefore require it. The configuration of the Identity Provider (IdP) is inserted into the oauth2_app and oauth2_app_scope tables in the database.

This page is the reference for those two tables, with a worked example. It assumes you have a running deployment as set up in Installation with Docker.

The oauth2_app table

One row per provider.

ColumnTypeRequiredDescription
oauth2_app_idbigint unsignedPrimary key (auto-increment).
provider_namevarchar(100)YesconnectCenter's internal name of the provider. It must be unique, and it appears in the redirection URI path.
issuer_urivarchar(200)Option aThe provider's base (issuer) endpoint, for providers that support the Well-Known URI Discovery mechanism — the provider publishes its metadata at {issuer_uri}/.well-known/openid-configuration.
authorization_urivarchar(200)Option bAuthorization endpoint, for providers that do not support Well-Known URI Discovery.
token_urivarchar(200)Option bToken endpoint.
user_info_urivarchar(200)Option bUser Info endpoint.
jwk_set_urivarchar(200)Option bJSON Web Key Set endpoint.
redirect_urivarchar(200)YesThe redirection URI to which the IdP sends the result of the client sign-in request through the OAuth 2.0 flows, in the form {scheme}://{hostname}/api/oauth2/code/{provider_name}scheme is http or https (optionally with a port number) and hostname is the hostname of connectCenter.
end_session_endpointvarchar(200)NoThe provider's end-session (sign-out) endpoint. When set, it is added to the client registration's provider metadata for RP-initiated logout.
client_idvarchar(200)YesThe client ID issued by the IdP for the registered application.
client_secretvarchar(200)YesThe client secret issued by the IdP for the registered application.
client_authentication_methodvarchar(50)YesClient authentication method; possible values are basic or post.
authorization_grant_typevarchar(50)YesAuthorization grant type; possible values are authorization_code, client_credentials, password, etc.
promptvarchar(20)NoFor IdPs that support the prompt parameter, display options during the sign-in process. Typical values are none, login, and consent.
display_provider_namevarchar(100)NoLabel of the provider's button on the connectCenter sign-in page.
background_colorvarchar(50)NoBackground color of the sign-in button.
font_colorvarchar(50)NoFont color of the sign-in button.
display_orderintNo (default 0)Order of the sign-in button among providers.
is_disabledtinyint(1)No (default 0)If set to 1 (true), the button for this provider is not shown.

For the IdP endpoints, configure either option a — issuer_uri alone, letting connectCenter discover the rest of the provider's metadata — or option b — the four individual endpoints. The redirect URI value may need to be registered in your IdP configuration; see your IdP documentation for the endpoint URLs and the supported authentication-method, grant-type, and prompt values.

The oauth2_app_scope table

One row per scope granted to the application.

ColumnTypeRequiredDescription
oauth2_app_scope_idbigint unsignedPrimary key (auto-increment).
oauth2_app_idbigint unsignedYesForeign key referencing oauth2_app.oauth2_app_id.
scopevarchar(100)YesAn OpenID Connect scope, such as openid, profile, email, or phone.

Example: registering Google as a provider

INSERT INTO `oauth2_app`
(`provider_name`,
`issuer_uri`,
`redirect_uri`,
`client_id`,
`client_secret`,
`client_authentication_method`,
`authorization_grant_type`,
`display_provider_name`, `background_color`, `font_color`)
VALUES
('google',
'https://accounts.google.com',
'https://example.score.com/api/oauth2/code/google',
'<client-id-issued-by-google>',
'<client-secret-issued-by-google>',
'post',
'authorization_code',
'Google', '#df4930', '#ffffff');

INSERT INTO `oauth2_app_scope` (`oauth2_app_id`, `scope`)
VALUES
((SELECT `oauth2_app_id` FROM `oauth2_app` WHERE `provider_name` = 'google'), 'openid'),
((SELECT `oauth2_app_id` FROM `oauth2_app` WHERE `provider_name` = 'google'), 'profile'),
((SELECT `oauth2_app_id` FROM `oauth2_app` WHERE `provider_name` = 'google'), 'email');

Whenever a property is changed in the database, the application — specifically the http-gateway (backend) service — must be restarted to load the changed information:

docker compose restart backend

Once users sign in through the provider, their sign-in requests appear as pending SSO accounts that an administrator approves — see Administration → Using Single Sign-On.

Resource-server JWT validation

The backend can also validate bearer tokens directly. Set the RS_JWK_SET_URI environment variable on the backend service to your provider's jwks_uri (its resource-server.jwk-set-uri setting). This is required when you add the external API service.