---
schema_version: "1"
id: 7549b83fe48151c3b0cb5cca9240b8f0315d9e55c9049439893473ec9118a831
title: SAML 疑难解答
collection: tableau
version: next
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/next/zh-cn/server/saml_trouble.md
canonical_url: https://help.tableau.com/v0.0/server/zh-cn/saml_trouble.htm
source_site: help.tableau.com
content_type: documentation
content_hash: f70aaefd4c38d811fc63d4ee0bbf2823daf00c7947e755d09ea5c8be4e47908c
description: Troubleshoot SAML authentication issues in Tableau Cloud.
---
[跳转到主要内容](#main-content)

# SAML 疑难解答

本主题提供相关信息，帮助解决在配置 SAML 身份验证时可能发生的问题。

## SAML 和启用自动登录

如果您使用 SAML 且 Tableau Server 还配置为使用 Active Directory，请不要同时选择“启用自动登录”。“启用自动登录”和 SAML 不能同时在同一服务器安装上使用。

## 配置 SAML 时出现 HTTP 状态 500 错误

在某些情况下，启用 SAML 并在浏览器中导航到 Tableau Server URL 之后，您可能会收到 HTTP 状态 500 错误并看到以下错误：

`org.opensaml.saml2.metadata.provider.MetadataProviderException: User specified binding is not supported by the Identity Provider using profile urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser`

为了帮助解决此错误，请确保以下各项：

- 在“SAML”选项卡中指定的 SSO 配置文件的 IdP URL 正确无误。
- 在 IdP 中创建服务提供程序时提供的 SSO 配置文件的 IdP URL 正确无误。
- IdP 配置为使用 `HTTP-POST` 请求。（不支持重定向和 SOAP。）

如果任何这些设置不正确，请进行适当的更新，然后再次执行 SAML 配置步骤，从通过 Tableau Server 生成和导出 XML 元数据文档开始。

如果这些设置正确无误，但您仍然看到错误，请检查 Tableau Server 和 IdP 生成的元数据 XML，如 [SAML 要求](https://help.tableau.com/v0.0/server/zh-cn/saml_requ.htm)中所述。

## 从命令行登录

当您使用 [tabcmd](https://help.tableau.com/v0.0/server/zh-cn/tabcmd.htm) 或 [Tableau 数据提取命令行实用程序](https://help.tableau.com/current/pro/desktop/zh-cn/extracting_TDE.htm)（Tableau Desktop 随附）登录到 Tableau Server 时，SAML 不用于进行身份验证，即使将 Tableau Server 配置为使用 SAML 也不例外。这些工具要求在最初安装 Tableau Server 时配置身份验证（本地身份验证或 AD）。

## 登录失败：未能找到用户

登录失败，并出现以下消息：

`>Login failure: Identity Provider authentication successful for user <username from IdP>. Failed to find the user in Tableau Server.`

此错误通常意味着 Tableau Server 中存储的用户名与 IdP 提供的用户名之间存在不匹配。若要修复此错误，请确保这些用户名匹配。例如，如果史珍妮的用户名在 IdP 中存储为 `jsmith`，那么它在 Tableau Server 中也必须存储为 `jsmith`。

## 登录失败：SSL 卸载

登录失败，并出现以下消息：

`Unable to Sign In - Invalid username or password.`

此外，vizportal 日志（设置为 `debug` 模式）包含以下消息：

`DEBUG com.tableau.core.util.RemoteIP - Found header null in X-FORWARDED-PROTO`

**注意：**若要记录 SAML 相关事件，`vizportal.log.level` 必须设置为 `debug`。有关详细信息，请参见[更改日志记录级别](https://help.tableau.com/v0.0/server/zh-cn/logs_debug_level.htm)。

这种消息组合指明将连接 SSL 卸载到 Tableau Server 的外部代理服务器的配置不正确。若要解决此问题，请参见[配置服务器范围 SAML](https://help.tableau.com/v0.0/server/zh-cn/config_saml.htm)。

## SAML 错误日志

SAML 身份验证在 Tableau Server 外部进行，因此，排查身份验证问题可能很困难。但是，Tableau Server 会记录登录尝试。可以创建日志文件的快照，并使用它们来排查问题。有关详细信息，请参见[日志文件快照（将日志存档）](https://help.tableau.com/v0.0/server/zh-cn/logs_archive.htm)。

**注意：**若要记录 SAML 相关事件，`vizportal.log.level` 必须设置为 `debug`。有关详细信息，请参见[更改日志记录级别](https://help.tableau.com/v0.0/server/zh-cn/logs_debug_level.htm)。

在未解压的日志文件快照内的以下文件中，检查 SAML 错误：

`\vizportal\vizportal-<n>.log`

应用程序进程 (vizportal.exe) 处理身份验证，因此 SAML 响应由该进程记录。

## 末尾斜杠

在“SAML”选项卡上，确认“Tableau Server 返回 URL”的末尾没有斜杠

正确：**http://tableau\_server**

错误：http://tableau\_server/

## 确认连接

确认您配置的 Tableau Server 具有可路由的 IP 地址，或者在防火墙上具有允许直接与服务器双向通信的 NAT。

若要测试连接，可以在 Tableau Server 上运行 telnet，并尝试与 SAML IdP 进行连接。例如：`C:\telnet 12.360.325.10 80`

以上测试应连接到 IdP 上的 HTTP 端口 (80)，而且您应收到 HTTP 标头。

## 多个域

在“SAML”选项卡上，确认 Tableau Server域属性将检测 SAML 断言中 `domain\username` 格式的域，方法是将其留空。

正确：<空>

不正确：yourdomain.com