4.3.2. 为红帽单点登录身份验证配置 OpenShift Master


登录 OpenShift 主控机 CLI。

前提条件

您必须具有编辑 /etc/origin/master/master-config.yaml 文件的权限。

流程

  1. 编辑 /etc/origin/master/master-config.yaml 文件并找到 identityProviders 部分。例如,如果 OpenShift 主控机配置了 HTPassword 身份提供程序,则 identityProviders 部分类似如下:

    identityProviders:
    - challenge: true
      login: true
      name: htpasswd_auth
      provider:
        apiVersion: v1
        file: /etc/origin/openshift-passwd
        kind: HTPasswdPasswordIdentityProvider

    添加 Red Hat Single Sign-On 作为二级身份提供程序,其内容类似于以下代码片段:

    - name: rh_sso
      challenge: false
      login: true
      mappingMethod: add
      provider:
        apiVersion: v1
        kind: OpenIDIdentityProvider
        clientID: openshift-demo
        clientSecret: 7b0384a2-b832-16c5-9d73-2957842e89h7
        ca: xpaas.crt
        urls:
          authorize: https://secure-sso-sso-app-demo.openshift32.example.com/auth/realms/OpenShift/protocol/openid-connect/auth
          token: https://secure-sso-sso-app-demo.openshift32.example.com/auth/realms/OpenShift/protocol/openid-connect/token
          userInfo: https://secure-sso-sso-app-demo.openshift32.example.com/auth/realms/OpenShift/protocol/openid-connect/userinfo
        claims:
          id:
          - sub
          preferredUsername:
          - preferred_username
          name:
          - name
          email:
          - email
    1. clientSecret 的 Red Hat Single Sign-On Secret hash 位于 Red Hat Single Sign-On web 控制台中: Clients openshift-demo Credentials
    2. 通过 Red Hat Single Sign-On 应用发出请求,可以找到 urls 的端点。例如:

      <curl -k https://secure-sso-sso-app-demo.openshift32.example.com/auth/realms/OpenShift/.well-known/openid-configuration | python -m json.tool>

      响应包括 authorization_endpointtoken_endpointuserinfo_endpoint

    3. 这个示例工作流使用自生成的 CA 为演示目的提供端到端工作流。因此,ca 作为 < ca: xpaas.crt> 提供。此 CA 证书还必须复制到 /etc/origin/master 文件夹。如果使用从验证的证书颁发机构购买的证书,则不需要这样做。
  2. 保存配置并重启 OpenShift master:

    $ systemctl restart atomic-openshift-master
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.