Chapter 9. Configuring OIDC for Red Hat Quay
OpenID Connect (OIDC) allows users to authenticate to Red Hat Quay by using their existing credentials from an OIDC provider, such as Red Hat Single Sign-On, Google, GitHub, Microsoft, or others. Other benefits of OIDC include centralized user management, enhanced security, and single sign-on (SSO).
The following procedures show you how to configure Microsoft Entra ID on a standalone deployment of Red Hat Quay, and how to configure Red Hat Single Sign-On on an Operator-based deployment of Red Hat Quay. These procedures are interchangeable depending on your deployment type.
By following these procedures, you can add any OIDC provider to Red Hat Quay, regardless of which identity provider you choose to use.
9.1. Configuring Microsoft Entra ID OIDC on a standalone deployment of Red Hat Quay Copy linkLink copied to clipboard!
To configure Microsoft Entra ID OIDC on a standalone Red Hat Quay deployment, you can add an AZURE_LOGIN_CONFIG block to your config.yaml file and restart the registry.
By integrating Microsoft Entra ID authentication with Red Hat Quay, your organization can take advantage of the centralized user management and security features offered by Microsoft Entra ID. Some features include the ability to manage user access to Red Hat Quay repositories based on their Microsoft Entra ID roles and permissions, and the ability to enable multi-factor authentication and other security features provided by Microsoft Entra ID.
Azure Active Directory (Microsoft Entra ID) authentication for Red Hat Quay allows users to authenticate and access Red Hat Quay by using their Microsoft Entra ID credentials.
- By using the following procedure, you can add any OIDC provider to Red Hat Quay, regardless of which identity provider is being added.
-
If your system has a firewall in use, or a proxy enabled, you must allowlist all Azure API endpoints for each OAuth application that is created. Otherwise, the following error is returned:
x509: certificate signed by unknown authority.
Procedure
Use the following reference and update your
config.yamlfile with your desired OIDC provider’s credentials:AUTHENTICATION_TYPE: OIDC # ... AZURE_LOGIN_CONFIG: CLIENT_ID: <client_id> CLIENT_SECRET: <client_secret> OIDC_SERVER: https://login.microsoftonline.com/<tenant-id>/v2.0/ SERVICE_NAME: Microsoft Entra ID OIDC_DISABLE_USER_ENDPOINT: true VERIFIED_EMAIL_CLAIM_NAME: <verified_email> USE_PKCE: True PKCE_METHOD: "S256" PUBLIC_CLIENT: True # ...where:
AZURE_LOGIN_CONFIG-
Specifies the parent key that holds the OIDC configuration settings. In this example, the parent key used is
AZURE_LOGIN_CONFIG. However, the stringAZUREcan be replaced with any arbitrary string based on your specific needs, for exampleABC123. The following strings are not accepted:GOOGLE,GITHUB. These strings are reserved for their respective identity platforms and require a specificconfig.yamlentry contingent upon which platform you are using. CLIENT_ID- Specifies the client ID of the application that is being registered with the identity provider.
CLIENT_SECRET- Specifies the client secret of the application that is being registered with the identity provider.
OIDC_SERVER-
Specifies the OIDC discovery base URL. The URL must end with a trailing
/because Red Hat Quay uses path joining for OIDC discovery. For new deployments, use the Entra ID v2.0 endpoint. To accept both v1.0 and v2.0 tokens during migration, configure multi-issuer OIDC. SERVICE_NAME- Specifies the name of the service that is being authenticated.
OIDC_DISABLE_USER_ENDPOINT-
Specifies whether to disable the
/userinfoendpoint. Set totruefor Microsoft Entra ID because Azure obtains user information from the token instead of calling the/userinfoendpoint. VERIFIED_EMAIL_CLAIM_NAME- Specifies the name of the claim that is used to verify the email address of the user.
USE_PKCE-
Specifies whether to enable Proof Key for Code Exchange (PKCE) for OIDC authentication. Defaults to
false. PKCE_METHOD-
Specifies the code challenge method used to generate the
code_challengesent in the initial authorization request. Defaults toS256. PUBLIC_CLIENT-
Specifies whether to omit
client_secretduring the token request when the client is public. Defaults tofalse.
Proper configuration of Microsoft Entra ID results in three redirects with the following format:
-
https://QUAY_HOSTNAME/oauth2/<name_of_service>/callback -
https://QUAY_HOSTNAME/oauth2/<name_of_service>/callback/attach -
https://QUAY_HOSTNAME/oauth2/<name_of_service>/callback/cli
-
- Restart your Red Hat Quay deployment.
9.2. Configuring Microsoft Entra ID v2 and multi-issuer OIDC Copy linkLink copied to clipboard!
To accept Microsoft Entra ID v2.0 tokens and On-Behalf-Of API flows in Red Hat Quay, you can configure multi-issuer and multi-audience settings in your OIDC *_LOGIN_CONFIG block. This support enables Microsoft Entra ID v2.0 access tokens, dual v1.0 and v2.0 acceptance during migration, and On-Behalf-Of (OBO) API flows used by integrations such as Red Hat Developer Hub (RHDH).
Prerequisites
- You have an Entra ID app registration for Red Hat Quay with a client secret and redirect URIs for your Red Hat Quay hostname.
-
You can edit the Red Hat Quay
config.yamlfile or OperatorconfigBundleSecretresource.
Procedure
In the Azure Portal, open your Red Hat Quay app registration and set
requestedAccessTokenVersionto2in the app manifest. The field might appear asapi.requestedAccessTokenVersion.For OBO flows, expose an API on the Red Hat Quay app registration, for example
api://quay-api, and grant the upstream application permission to that scope.Update your
*_LOGIN_CONFIGblock with the v2.0 discovery endpoint and multi-issuer settings. For example:AUTHENTICATION_TYPE: OIDC # ... AZURE_LOGIN_CONFIG: CLIENT_ID: <quay_app_client_id> CLIENT_SECRET: <quay_app_client_secret> OIDC_SERVER: https://login.microsoftonline.com/<tenant-id>/v2.0/ SERVICE_NAME: Microsoft Entra ID OIDC_DISABLE_USER_ENDPOINT: true OIDC_ISSUERS: - https://sts.windows.net/<tenant-id>/ - https://login.microsoftonline.com/<tenant-id>/v2.0 OIDC_AUDIENCES: - <quay_app_client_id> - api://quay-api OIDC_ALLOWED_CLIENTS: - <quay_app_client_id> - <upstream_app_client_id> USE_PKCE: true PKCE_METHOD: "S256" PUBLIC_CLIENT: true # ...Restart your Red Hat Quay deployment or reconcile the Operator so the updated configuration is applied.
Note-
Set
OIDC_SERVERto the v2.0 endpoint. The v2.0 JWKS endpoint includes v1.0 signing keys, so one discovery URL supports both token versions. -
If you set
OIDC_ALLOWED_CLIENTS, include your Red Hat Quay application’s ownCLIENT_ID. Direct user logins setazpto the application’s client ID. OmitOIDC_ALLOWED_CLIENTSif you do not need to restrict OBO clients. -
Do not request Microsoft Graph scopes such as
openid profile emailwhen you need tokens with a custom audience. Use application-specific scopes such asapi://quay-api/registry.accessinstead.
-
Set
9.3. Migrating from Entra ID v1.0 to v2.0 Copy linkLink copied to clipboard!
To migrate from Microsoft Entra ID v1.0 to v2.0 without interrupting clients in Red Hat Quay, you can set the v2.0 discovery endpoint and temporarily list both issuers in OIDC_ISSUERS.
Procedure
-
Set
OIDC_SERVERto the v2.0 endpoint (https://login.microsoftonline.com/<tenant-id>/v2.0/). Add both issuer URLs to
OIDC_ISSUERS:OIDC_ISSUERS: - https://sts.windows.net/<tenant-id>/ - https://login.microsoftonline.com/<tenant-id>/v2.0- Update upstream clients to v2.0 tokens.
-
After all clients use v2.0, remove the v1.0 issuer from
OIDC_ISSUERS.
9.4. Configuring On-Behalf-Of (OBO) flows Copy linkLink copied to clipboard!
To allow an upstream service to call Red Hat Quay APIs on behalf of authenticated users, you can configure On-Behalf-Of (OBO) audiences and allowed clients in your Entra ID OIDC settings.
Procedure
-
In the Azure Portal, expose an API on the Red Hat Quay app registration and add a scope, for example
registry.accessunderapi://quay-api. - Create a second app registration for the upstream service and grant it permission to the Red Hat Quay API scope.
-
Add the exposed API identifier to
OIDC_AUDIENCESin your Red Hat Quay configuration, for exampleapi://quay-api. Add the upstream application’s client ID to
OIDC_ALLOWED_CLIENTS.OBO tokens have
aud: api://quay-apiandazp: <upstream_client_id>. Red Hat Quay validates both claims.
9.5. Troubleshooting Microsoft Entra ID OIDC Copy linkLink copied to clipboard!
Use this reference to resolve common Microsoft Entra ID OIDC errors in Red Hat Quay, including issuer, audience, allowed client, and JWKS signature failures.
| Error or symptom | Resolution |
|---|---|
| Issuer not configured |
The token |
| Audience doesn’t match |
The token |
| Client is not in the allowed clients list |
The token |
| Signature verification failed |
JWKS keys from |
| OIDC discovery fails |
|
9.6. Configuring Red Hat Single Sign-On for Red Hat Quay Copy linkLink copied to clipboard!
You can configure Red Hat Single Sign-On (RH-SSO) as an OpenID Connect provider for Red Hat Quay on OpenShift Container Platform. Create an RH-SSO client, then add an RHSSO_LOGIN_CONFIG block to your Operator config bundle.
Based on the Keycloak project, Red Hat Single Sign-On (RH-SSO) is an open source identity and access management (IAM) solution provided by Red Hat. RH-SSO allows organizations to manage user identities, secure applications, and enforce access control policies across their systems and applications. It also provides a unified authentication and authorization framework, which allows users to log in one time and gain access to multiple applications and resources without needing to re-authenticate.
By configuring Red Hat Single Sign-On on Red Hat Quay, you can create a seamless authentication integration between Red Hat Quay and other application platforms like OpenShift Container Platform.
9.6.1. Configuring the Red Hat Single Sign-On Operator for use with the Red Hat Quay Operator Copy linkLink copied to clipboard!
To prepare Red Hat Single Sign-On for Red Hat Quay on OpenShift Container Platform, you can create a confidential OIDC client in the RH-SSO Admin Console and copy the client secret.
Prerequisites
- You have configured the Red Hat Single Sign-On Operator.
- You have configured SSL/TLS for your Red Hat Quay on OpenShift Container Platform deployment and for Red Hat Single Sign-On.
- You have generated a single Certificate Authority (CA) and uploaded it to your Red Hat Single Sign-On Operator and to your Red Hat Quay configuration.
Procedure
Navigate to the Red Hat Single Sign-On Admin Console.
-
On the OpenShift Container Platform Web Console, navigate to Network
Route. - Select the Red Hat Single Sign-On project from the drop-down list.
- Find the Red Hat Single Sign-On Admin Console in the Routes table.
-
On the OpenShift Container Platform Web Console, navigate to Network
- Select the Realm that you use to configure Red Hat Quay.
- Click Clients under the Configure section of the navigation panel, and then click Create to add a new OIDC client for Red Hat Quay.
Enter the following information:
-
Client ID:
quay-enterprise -
Client Protocol:
openid-connect -
Root URL:
https://<quay_endpoint>/
-
Client ID:
- Click Save. This results in a redirect to the Clients setting panel.
- Navigate to Access Type and select Confidential.
Navigate to Valid Redirect URIs. You must provide three redirect URIs. The value should be the fully qualified domain name of the Red Hat Quay registry appended with
/oauth2/redhatsso/callback. For example:-
https://<quay_endpoint>/oauth2/redhatsso/callback -
https://<quay_endpoint>/oauth2/redhatsso/callback/attach -
https://<quay_endpoint>/oauth2/redhatsso/callback/cli
-
- Click Save and navigate to the new Credentials setting.
- Copy the value of the Secret.
9.6.2. Configuring the Red Hat Quay Operator to use Red Hat Single Sign-On Copy linkLink copied to clipboard!
To enable Red Hat Single Sign-On authentication for an Operator-based Red Hat Quay deployment, you can add an RHSSO_LOGIN_CONFIG block to your config bundle and restart the registry.
Prerequisites
- You have configured the Red Hat Single Sign-On Operator.
- You have configured SSL/TLS for your Red Hat Quay on OpenShift Container Platform deployment and for Red Hat Single Sign-On.
- You have generated a single Certificate Authority (CA) and uploaded it to your Red Hat Single Sign-On Operator and to your Red Hat Quay configuration.
Procedure
-
Edit your Red Hat Quay
config.yamlfile by navigating to OperatorsInstalled Operators Red Hat Quay Quay Registry Config Bundle Secret. Then, click Actions Edit Secret. Alternatively, you can update the config.yamlfile locally. Add the following information to your Red Hat Quay on OpenShift Container Platform
config.yamlfile:# ... RHSSO_LOGIN_CONFIG: CLIENT_ID: <client_id> CLIENT_SECRET: <client_secret> OIDC_SERVER: <oidc_server_url> SERVICE_NAME: <service_name> SERVICE_ICON: <service_icon> VERIFIED_EMAIL_CLAIM_NAME: <example_email_address> PREFERRED_USERNAME_CLAIM_NAME: <preferred_username> LOGIN_SCOPES: [ 'openid', 'roles' ] USE_PKCE: true PKCE_METHOD: "S256" # ...where:
RHSSO_LOGIN_CONFIG-
Specifies the parent key that holds the OIDC configuration settings. In this example, the parent key used is
RHSSO_LOGIN_CONFIG. The string can be replaced with any arbitrary string based on your specific needs, for exampleABC123. However, the stringsGOOGLEandGITHUBare not accepted. These strings are reserved for their respective identity platforms and require a specificconfig.yamlentry contingent upon which platform you are using. CLIENT_ID-
Specifies the client ID of the application that is being registered with the identity provider. For example,
quay. CLIENT_SECRET- Specifies the client secret.
OIDC_SERVER-
Specifies the fully qualified domain name (FQDN) of the Red Hat Single Sign-On instance, appended with
/auth/realms/and the Realm name. You must include the forward slash at the end, for example,https://sso-redhat.example.com/auth/realms/<your_realm_name>/. SERVICE_NAME-
Specifies the name that is displayed on the Red Hat Quay login page, for example,
Red Hat Single Sign-On. SERVICE_ICON-
Specifies the icon on the login screen. For example,
/static/img/RedHat.svg. VERIFIED_EMAIL_CLAIM_NAME- Specifies the name of the claim that is used to verify the email address of the user.
PREFERRED_USERNAME_CLAIM_NAME- Specifies the name of the claim that is used for the preferred username of the user.
LOGIN_SCOPES-
Specifies the scopes to send to the OIDC provider when performing the login flow, for example,
openid. USE_PKCE-
Specifies whether to enable Proof Key for Code Exchange (PKCE). Defaults to
false. PKCE_METHOD-
Specifies the code challenge method used to generate the
code_challengesent in the initial authorization request. Defaults toS256.
- Restart your Red Hat Quay on OpenShift Container Platform deployment with Red Hat Single Sign-On enabled.
9.7. Team synchronization for Red Hat Quay OIDC deployments Copy linkLink copied to clipboard!
You can sync Red Hat Quay team membership with groups from an OpenID Connect (OIDC) identity provider. Enable team syncing in your config.yaml file, then configure directory sync for a team in the UI.
9.7.1. Enabling synchronization for Red Hat Quay OIDC deployments Copy linkLink copied to clipboard!
To enable team synchronization when your Red Hat Quay deployment uses an OIDC authenticator, you can set the team syncing fields in your config.yaml file and restart the registry.
The following procedure does not use a specific OIDC provider. Instead, it provides a general outline of how best to approach team synchronization between an OIDC provider and Red Hat Quay. Any OIDC provider can be used to enable team synchronization, however, setup might vary depending on your provider.
Procedure
Update your
config.yamlfile with the following information:AUTHENTICATION_TYPE: OIDC # ... OIDC_LOGIN_CONFIG: CLIENT_ID: CLIENT_SECRET: OIDC_SERVER: SERVICE_NAME: PREFERRED_GROUP_CLAIM_NAME: LOGIN_SCOPES: [ 'openid', '<example_scope>' ] OIDC_DISABLE_USER_ENDPOINT: false # ... FEATURE_TEAM_SYNCING: true FEATURE_NONSUPERUSER_TEAM_SYNCING_SETUP: true FEATURE_UI_V2: true # ...where:
CLIENT_ID- Specifies the registered OIDC client ID for this Red Hat Quay instance. This field is required.
CLIENT_SECRET- Specifies the registered OIDC client secret for this Red Hat Quay instance. This field is required.
OIDC_SERVER-
Specifies the address of the OIDC server that is being used for authentication. This URL should be such that a
GETrequest to<OIDC_SERVER>/.well-known/openid-configurationreturns the provider’s configuration information. This field is required. SERVICE_NAME- Specifies the name of the service that is being authenticated. This field is required.
PREFERRED_GROUP_CLAIM_NAME- Specifies the key name within the OIDC token payload that holds information about the user’s group memberships. This field allows the authentication system to extract group membership information from the OIDC token so that it can be used with Red Hat Quay. This field is required.
LOGIN_SCOPES-
Specifies the scopes Red Hat Quay requests during login. Must include
'openid'. Each scope must also be listed in the identity provider’sscopes_supportedfrom/.well-known/openid-configuration. This field is required. OIDC_DISABLE_USER_ENDPOINT-
Specifies whether to allow or disable the
/userinfoendpoint. If using Azure Entra ID, set this field totrue. Defaults tofalse. FEATURE_TEAM_SYNCING- Specifies whether to allow team membership to be synced from a backing group in the authentication engine. This field is required.
FEATURE_NONSUPERUSER_TEAM_SYNCING_SETUP- Optional. If enabled, non-superusers can configure team synchronization.
- Restart your Red Hat Quay registry.
9.7.2. Setting up your Red Hat Quay deployment for team synchronization Copy linkLink copied to clipboard!
To sync a Red Hat Quay team with an OIDC group, you can create an organization and team in the UI, enable directory sync, and verify membership changes from the identity provider.
Prerequisites
- You have enabled team synchronization for your OIDC-authenticated Red Hat Quay deployment.
Procedure
- Log in to your Red Hat Quay registry by using your OIDC provider.
- On the Red Hat Quay v2 UI dashboard, click Create Organization.
-
Enter an organization name, for example,
test-org. - Click the name of the organization.
- In the navigation pane, click Teams and membership.
-
Click Create new team and enter a name, for example,
testteam. On the Create team pop-up:
- Optional. Add this team to a repository.
-
Add a team member, for example,
user1, by typing in the user’s account name. - Add a robot account to this team. This page provides the option to create a robot account.
- Click Next.
- On the Review and Finish page, review the information that you have provided and click Review and Finish.
- To enable team synchronization for your Red Hat Quay OIDC deployment, click Enable Directory Sync on the Teams and membership page.
You are prompted to enter the group Object ID if your OIDC authenticator is Azure Entra ID, or the group name if using a different provider.
WarningAfter you enable team syncing, membership of users who are already part of the team is revoked. The OIDC group is the single source of truth. This action is not reversible. Team user membership from within Red Hat Quay is read-only.
- Click Enable Sync.
You are returned to the Teams and membership page. Note that users of this team are removed and are re-added upon logging back in. At this stage, only the robot account is still part of the team.
A banner at the top of the page confirms that the team is synced:
This team is synchronized with a group in OIDC and its user membership is therefore read-only.By clicking the Directory Synchronization Config accordion, the OIDC group that your deployment syncs with appears.
- Log out of your Red Hat Quay registry.
Verification
- Log back in to your Red Hat Quay registry.
-
Click Organizations
test-org test-team Teams and memberships. user1now appears as a team member for this team. - Navigate to your OIDC provider’s administration console.
- Navigate to the Users page of your OIDC provider. The name of this page varies depending on your provider.
-
Click the name of the user associated with Red Hat Quay, for example,
user1. - Remove the user from the group in the configured identity provider.
- Remove, or unassign, the access permissions from the user.
- Log in to your Red Hat Quay registry.
-
Click Organizations
test-org test-team Teams and memberships. user1has been removed from this team.