一组用于共享和管理内容、知识和应用程序的 Microsoft 产品和技术。
社区成员已将此帖子与类似的问题关联:
用ExecuteQuery()访问sharepoint link时,提示Identity Client Runtime Library (IDCRL) could not look up the realm information for a federated sign-in.
只有审查方才能编辑此内容。
用代码访问sharepoint link时,提示Identity Client Runtime Library (IDCRL) could not look up the realm information for a federated sign-in.
使用C#编写了以下代码,试图访问sharepoint的link,
程序执行过程中提示错误:
Identity Client Runtime Library (IDCRL) could not look up the realm information for a federated sign-in.
程序代码:
using Microsoft.SharePoint.Client;
using System;
using (ClientContext context = new ClientContext(SiteURL)
{
try
{
// 初始化保存账号密码的变量并保存密码
var securePassword = new System.Security.SecureString();
foreach (char c in password)
{
securePassword.AppendChar(c);
}
// 通过API生成访问sharepoint的凭据
context.Credentials = new SharePointOnlineCredentials(userName, securePassword);
Web web = context.Web;
context.Load(web);
context.ExecuteQuery(); -》这里执行时报错。参考程序执行时的错误内容
}
catch (Exception ex)
{
CommonUtils.Log(clazzName + ": checkStandardFileLinkAccessToVisit():Error :" + ex.Message);
Console.WriteLine(ex.Message);
return false;
}
}
程序执行时的错误内容:
Identity Client Runtime Library (IDCRL) could not look up the realm information for a federated sign-in.
希望回复的内容:
1.以上代码执行时出错的原因是什么?
2.如何解决?使代码可以成功访问sharepoint link?
希望回复期限:
2025/9/18 17:00(该问题比较着急,希望能尽快回复。)