8.9.5. OpenID Connect를 사용하여 제품 인증 정의
OAuth 2.0 흐름에 대한 인증에 OIDC (OpenID Connect )를 사용하는 3scale 제품에 대한 제품 사용자 지정 리소스를 배포할 수 있습니다. 3scale은 OpenID Connect와 같은 타사 IdM(Identity Providers)과 통합되어 API 요청을 인증합니다. OpenID Connect에 대한 자세한 내용은 OpenID Connect 통합을 참조하십시오. 타사 IdP와 통합한 후 제품 사용자 정의 리소스에 포함할 두 가지 유형의 데이터를 보유하게 됩니다.
-
issuerType: 타사 IdP와 통합할 때 Red Hat Single Sign-On(RH-SSO)과나머지가치를 사용할 때keycloak의 가치. -
issuerEndpoint: 이 파일에 필요한 자격 증명이 있는 URL입니다.
사전 요구 사항
- RH-SSO를 구성해야 합니다. Red Hat Single Sign-On 구성을 참조하십시오.
- 타사 ID 프로바이더와 HTTP 통합을 구성해야 합니다.
issuerEndpoint 에 제공된 자격 증명 CLIENT_ID 및 CLIENT_CREDENTIALS 에는 영역에서 다른 클라이언트를 관리할 수 있는 충분한 권한이 있어야 합니다.
절차
OpenID 공급자의 위치를 정의하고 제품 사용자 정의 리소스에서 이 형식을 사용하는 끝점
issuerEndpoint를 결정합니다.https://<client_id>:<client_secret>@<host>:<port_number>/auth/realms/<realm_name>`OAuth 2.0 흐름에 대해 OIDC(OpenID Connect) 인증을 지정하는 3scale
제품CR을 정의하거나 업데이트합니다. 예를 들면 다음과 같습니다.apiVersion: capabilities.3scale.net/v1beta1 kind: Product metadata: name: product1 spec: name: "OperatedProduct 1" deployment: <any>: authentication: oidc: issuerType: "keycloak" issuerEndpoint: "https://myclientid:myclientsecret@mykeycloack.example.com/auth/realms/myrealm" authenticationFlow: standardFlowEnabled: false implicitFlowEnabled: true serviceAccountsEnabled: true directAccessGrantsEnabled: true jwtClaimWithClientID: "azp" jwtClaimWithClientIDType: "plain"방금 정의한 리소스를 생성합니다. 예를 들면 다음과 같습니다.
oc create -f product1.yaml주어진 예에서 출력은 다음과 같습니다.
product.capabilities.3scale.net/product1 created
추가 리소스