第3章 Configuring Apicurio Registry security options
This chapter explains how to set configuration options for Apicurio Registry security. For example, this includes authentication in Red Hat build of Keycloak or Microsoft Azure Active Directory and role-based authorization in Apicurio Registry.
For a list of all available configuration options, see 13章Apicurio Registry configuration reference.
3.1. Configuring Apicurio Registry authentication and authorization with Red Hat build of Keycloak リンクのコピーリンクがクリップボードにコピーされました!
This section explains how to manually configure authentication and authorization options for Apicurio Registry and Red Hat build of Keycloak.
Alternatively, for details on how to configure these settings automatically, see 「Configuring Apicurio Registry authentication and authorization with Red Hat build of Keycloak」.
The Apicurio Registry web console and core REST API support authentication in Red Hat build of Keycloak based on OAuth and OpenID Connect (OIDC). The same Red Hat build of Keycloak realm and users are federated across the Apicurio Registry web console and core REST API using OpenID Connect so that you only require one set of credentials.
Apicurio Registry provides role-based authorization for default admin, write, and read-only user roles. Apicurio Registry provides content-based authorization at the schema or API level, where only the creator of the registry artifact can update or delete it. Apicurio Registry authentication and authorization settings are disabled by default.
Prerequisites
- Red Hat build of Keycloak is installed and running. For more details, see the Red Hat build of Keycloak user documentation.
- Apicurio Registry is installed and running.
Procedure
-
In the Red Hat build of Keycloak Admin Console, create a Red Hat build of Keycloak realm for Apicurio Registry. By default, Apicurio Registry expects a realm name of
registry. For details on creating realms, see the the Red Hat build of Keycloak user documentation. Create a Red Hat build of Keycloak client for the Apicurio Registry API. By default, Apicurio Registry expects the following settings:
-
Client ID:
registry-api -
Client Protocol:
openid-connect Access Type:
bearer-onlyYou can use the defaults for the other client settings.
注記If you are using Red Hat build of Keycloak service accounts, the client Access Type must be
confidentialinstead ofbearer-only.
-
Client ID:
Create a Red Hat build of Keycloak client for the Apicurio Registry web console. By default, Apicurio Registry expects the following settings:
-
Client ID:
apicurio-registry -
Client Protocol:
openid-connect -
Access Type:
public -
Valid Redirect URLs:
http://my-registry-url:8080/* Web Origins:
+You can use the defaults for the other client settings.
-
Client ID:
In your Apicurio Registry deployment on OpenShift, set the following Apicurio Registry environment variables to configure authentication using Red Hat build of Keycloak:
表3.1 Configuration for Apicurio Registry authentication with Red Hat build of Keycloak Environment variable Description Type Default QUARKUS_OIDC_TENANT_ENABLEDEnables authentication for Apicurio Registry. When set to
true, the environment variables that follow are required for authentication using Red Hat build of Keycloak.String
falseQUARKUS_OIDC_AUTH_SERVER_URLThe URL of the Red Hat build of Keycloak authentication server. For example,
http://localhost:8080.String
-
QUARKUS_OIDC_CLIENT_IDThe client ID for the Apicurio Registry REST API.
String
registry-apiAPICURIO_UI_AUTH_OIDC_CLIENT-IDThe client ID for the Apicurio Registry web console.
String
apicurio-registryヒントFor an example of setting environment variables on OpenShift, see 「Configuring Apicurio Registry health checks on OpenShift」.
Set the following option to
trueto enable Apicurio Registry user roles in Red Hat build of Keycloak:表3.2 Configuration for Apicurio Registry role-based authorization Environment variable Java system property Type Default value APICURIO_AUTH_ROLE-BASED-AUTHORIZATIONapicurio.auth.role-based-authorizationBoolean
falseWhen Apicurio Registry user roles are enabled, you must assign Apicurio Registry users to at least one of the following default user roles in your Red Hat build of Keycloak realm:
表3.3 Default user roles for registry authentication and authorization Role Read artifacts Write artifacts Global rules Summary sr-adminYes
Yes
Yes
Full access to all create, read, update, and delete operations.
sr-developerYes
Yes
No
Access to create, read, update, and delete operations, except configuring global rules. This role can configure artifact-specific rules.
sr-readonlyYes
No
No
Access to read and search operations only. This role cannot configure any rules.
Set the following to
trueto enable owner-only authorization for updates to schema and API artifacts in Apicurio Registry:表3.4 Configuration for owner-only authorization Environment variable Java system property Type Default value APICURIO_AUTH_OWNER-ONLY-AUTHORIZATION_LIMIT-GROUP-ACCESSapicurio.auth.owner-only-authorization.limit-group-accessBoolean
false