---
schema_version: "1"
id: 1f188e9405e107e5feac08f6f222c93e39f23d9ca002237246de073fdab75071
title: 无效用户（SharePoint 或 C#）
collection: tableau
version: next
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/next/zh-cn/server/trusted_auth_trouble_invaliduser.md
canonical_url: https://help.tableau.com/v0.0/server/zh-cn/trusted_auth_trouble_invaliduser.htm
source_site: help.tableau.com
content_type: documentation
content_hash: d2aefaa6cd24e52733b974fa12cfbcbf493aa6b8b5e72201db1364cac9cb505a
description: Resolve the Invalid User error in SharePoint or C# trusted authentication.
---
[跳转到主要内容](#main-content)

# 无效用户（SharePoint 或 C#）

如果您将 Tableau Server 配置为使用受信任的身份验证，则可能会遇到此错误。

SharePoint .dll 的示例代码引用以下 GET 请求：

SPContext.Current.Web.CurrentUser.Name

上面的请求将返回当前 Windows Active Directory 用户的显示名称。如果要使用登录 ID，则需要将代码更改为：

SPContext.Current.Web.CurrentUser.LoginName

进行更改后，请重新编译 SharePoint .dll。