5.8. 使用红帽构建的 Keycloak 作为身份验证源登录到 Satellite


当红帽构建的 Keycloak 配置为 Satellite 的外部身份验证源后,红帽构建 Keycloak 域中定义的用户可以登录到 Satellite 服务器。用户可用的特定登录方法取决于您如何在红帽构建的 Keycloak 和 Satellite 之间配置集成。

流程

向 Satellite Web UI 进行身份验证:

  • 在您的浏览器中,进入 https://satellite.example.com 并输入您的凭证。

使用红帽构建的 Keycloak TOTP 向 Satellite Web UI 进行身份验证:

  1. 在您的浏览器中,登录 Satellite。Satellite 将您重定向到红帽构建的 Keycloak 登录屏幕。
  2. 输入您的用户名和密码,然后单击 Log In
  3. 首次登录时,红帽通过扫描条代码并输入 PIN 来为您配置客户端的 Keycloak 请求。经过身份验证后,您的浏览器会将您重新重定向到 Satellite 并登录。

使用 Hammer 向 Satellite CLI 进行身份验证:

  1. 确保 Hammer 配置为强制 ~/.hammer/cli.modules.d/foreman.yml 中的会话使用:

    :foreman:
      :use_sessions: true
    Copy to Clipboard
  2. 使用 hammer auth 登录 oauth 启动身份验证会话:

    • 如果您初始化了没有 --http-relative-path=/auth 上下文路径的 Keycloak 服务器的红帽构建:

      $ hammer auth login oauth \
      --oidc-token-endpoint 'https://rhbk.example.com:8443/realms/Satellite_realm/protocol/openid-connect/token' \
      --oidc-authorization-endpoint 'https://rhbk.example.com:8443' \
      --oidc-client-id 'satellite.example.com-hammer-openidc' \
      --oidc-redirect-uri urn:ietf:wg:oauth:2.0:oob
      Copy to Clipboard
    • 如果您使用-- http-relative-path=/auth 上下文路径初始化了红帽构建的 Keycloak 服务器:

      $ hammer auth login oauth \
      --oidc-token-endpoint 'https://rhbk.example.com:8443/auth/realms/Satellite_realm/protocol/openid-connect/token' \
      --oidc-authorization-endpoint 'https://rhbk.example.com:8443/auth' \
      --oidc-client-id 'satellite.example.com-hammer-openidc' \
      --oidc-redirect-uri urn:ietf:wg:oauth:2.0:oob
      Copy to Clipboard

使用红帽构建的 Keycloak TOTP 向 Satellite CLI 进行身份验证:

  1. 确保 Hammer 配置为强制 ~/.hammer/cli.modules.d/foreman.yml 中的会话使用:

    :foreman:
      :use_sessions: true
    Copy to Clipboard
  2. 使用带有 hammer auth login oauth--two-factor 启动身份验证会话:

    $ hammer auth login oauth \
    --two-factor \
    --oidc-token-endpoint 'https://rhbk.example.com:8443/auth/realms/Satellite_realm/protocol/openid-connect/token' \
    --oidc-authorization-endpoint 'https://rhbk.example.com:8443/auth' \
    --oidc-client-id 'satellite.example.com-hammer-openidc' \
    --oidc-redirect-uri urn:ietf:wg:oauth:2.0:oob
    Copy to Clipboard
  3. 系统将提示您输入成功代码。若要检索成功代码,可导航到命令返回的 URL。
  4. 在 CLI 中输入成功代码。
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat