7.8.3. Google CR 示例

以下自定义资源 (CR) 显示 Google 身份提供程序的参数和可接受值。

Google CR

apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
  name: cluster
spec:
  identityProviders:
  - name: googleidp 1
    mappingMethod: claim 2
    type: Google
    google:
      clientID: {...} 3
      clientSecret: 4
        name: google-secret
      hostedDomain: "example.com" 5

1
此提供程序名称作为前缀放在 Google 数字用户 ID 前,以此组成身份名称。它还可用来构建的重定向 URL。
2
控制如何在此提供程序的身份和 User 对象之间建立映射。
3
注册的 Google 项目的客户端 ID 。项目必须配置有重定向 URI https://oauth-openshift.apps.<cluster-name>.<cluster-domain>/oauth2callback/<idp-provider-name>
4
对包含 Google 发布的客户端 Secret 的 OpenShift Container Platform Secret 的引用。
5
用于限制登录帐户的托管域。如果使用了 lookup mappingMethod,则可选。如果为空,任何 Google 帐户都可进行身份验证。

其他资源

  • 如需了解所有身份提供程序通用的参数(如 mappingMethod )的信息,请参阅身份提供程序参数