このコンテンツは選択した言語では利用できません。
Chapter 2. 3scale integration with Red Hat Single Sign-On using OpenID Connect
3scale can synchronize client credentials between 3scale (Application credentials) and a Red Hat Single Sign-On server using OpenID Connect (OIDC). 3scale utilizes a service called Zync to synchronize calls to the Red Hat Single Sign-On server.
2.1. Prerequisites: リンクのコピーリンクがクリップボードにコピーされました!
- 3scale 2.2
- A Red Hat Single Sign-On version as specified on the Supported Configurations page.
- SSL connection between Zync and RHSSO.
In order to connect 3scale and Red Hat Single Sign-On, perform the following configurations in Zync, your Red Hat Single Sign-On server and 3scale:
2.2. Configure Zync リンクのコピーリンクがクリップボードにコピーされました!
3scale 2.2 and above supports custom CA certificates for Red Hat Single Sign-On with the SSL_CERT_FILE environment variable. This variable points to the local path of the certificates bundle. Configure it as follows:
Validate the new certificate with the following cURL command. The expected response is a JSON configuration of the realm. If validation fails it is an indicator that your certificate may not be correct.
curl -v https://<secure-sso-host>/auth/realms/master --cacert customCA.pem
curl -v https://<secure-sso-host>/auth/realms/master --cacert customCA.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the certificate bundle to the Zync pod:
Gather the existing content of the
/etc/pki/tls/cert.pemfile on the Zync pod. Run:oc exec <zync-pod-id> cat /etc/pki/tls/cert.pem > zync.pem
oc exec <zync-pod-id> cat /etc/pki/tls/cert.pem > zync.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Append the contents of the custom CA certificate file to
zync.pem:cat customCA.pem >> zync.pem
cat customCA.pem >> zync.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Attach the new file to the Zync pod as a ConfigMap:
oc create configmap zync-ca-bundle --from-file=./zync.pem
oc create configmap zync-ca-bundle --from-file=./zync.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc set volume dc/zync --add --name=zync-ca-bundle --mount-path /etc/pki/tls/zync/zync.pem --sub-path zync.pem --source='{"configMap":{"name":"zync-ca-bundle","items":[{"key":"zync.pem","path":"zync.pem"}]}}'oc set volume dc/zync --add --name=zync-ca-bundle --mount-path /etc/pki/tls/zync/zync.pem --sub-path zync.pem --source='{"configMap":{"name":"zync-ca-bundle","items":[{"key":"zync.pem","path":"zync.pem"}]}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc patch dc/zync --type=json -p '[{"op": "add", "path": "/spec/template/spec/containers/0/volumeMounts/0/subPath", "value":"zync.pem"}]'oc patch dc/zync --type=json -p '[{"op": "add", "path": "/spec/template/spec/containers/0/volumeMounts/0/subPath", "value":"zync.pem"}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After deployment, verify that the certificate is attached and the content is correct:
oc exec <zync-pod-id> cat /etc/pki/tls/zync/zync.pem
oc exec <zync-pod-id> cat /etc/pki/tls/zync/zync.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the
SSL_CERT_FILEenvironment variable on Zync to point to the new CA certificate bundle:oc set env dc/zync SSL_CERT_FILE=/etc/pki/tls/zync/zync.pem
oc set env dc/zync SSL_CERT_FILE=/etc/pki/tls/zync/zync.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Configure Red Hat Single Sign-On リンクのコピーリンクがクリップボードにコピーされました!
- Create a realm
Create a client:
- Specify a client ID
-
Select the
openid-connectclient protocol
Configure client permissions, setting the following:
-
Access Typeto confidential -
Standard Flow Enabledto OFF -
Direct Access Grants Enabledto OFF -
Service Accounts Enabledto ON
-
Set service account roles for your client
- Navigate to the service account roles tab of your client
-
In the client roles dropdown, select
realm management -
In the available roles pane, select the
manage-clientslist item and assign the role by clickingAdd Roles
Note client credentials
- Take note of the client ID
-
Navigate to the
Credentialstab of your client and take note of the secret
Add a user to the realm:
- Click on the Users menu on the left side of the screen
- Click the Add user button
- Type the username, set the Email Verified switch to ON and click the Save button
-
Go the Credentials tab to set the password. Enter the password in both fields, set the Temporary switch to
OFFto avoid the password reset at the next login, and click on Reset Password - Click on the Change password button in the pop-up dialog
2.4. Configure 3scale リンクのコピーリンクがクリップボードにコピーされました!
Once you have created and configured a server and client in Red Hat Single Sign-On, you must configure 3scale to work with Red Hat Single Sign-On:
Enable OIDC
-
Select the service on which you want to enable Red Hat Single Sign-On, navigate to the APIs
<your_service_name> integration page - On that page, select edit integration settings
-
Under the
Authenticationdeployment options, selectOpenID Connect - Update the service
-
Select the service on which you want to enable Red Hat Single Sign-On, navigate to the APIs
Edit Your APIcast Configuration
-
navigate to the APIs
<your_service_name> integration page - On that page, select edit APIcast configuration
Under the Authentication Settings expandable heading, in the OpenID Connect Issuer field, enter your previously noted client credentials with the URL of your Red Hat Single Sign-On server:
https://<CLIENT_ID>:<CLIENT_SECRET>@<HOST>:<PORT>/auth/realms/<REALM_NAME>
https://<CLIENT_ID>:<CLIENT_SECRET>@<HOST>:<PORT>/auth/realms/<REALM_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save your configuration
-
navigate to the APIs
2.5. Test Integration リンクのコピーリンクがクリップボードにコピーされました!
Peform the following procedures in 3scale and verify the results in Red Hat Single Sign-On to test your integration:
| 3scale Procedure | Red Hat Single Sign-On Result |
|---|---|
| Create an application for the service where you configured the OpenID Connect Issuer. Note the Client ID and client secret generated for the application | The new client appears in the Red Hat Single Sign-On realm you are using |
| Change the Redirect URL on the application in 3Scale | The Redirect URL was updated |
| Delete the application | The client is deleted from the realm |