I'm getting a ClientRequestException when tryi

2019-08-24 15:41发布

Hellu

This exception appeared for no reason at all, just like that. 15 minutes earlier, I had no problems at all. Maybe someone at my office did something with our SharePoint Online, but it's seems unlikely as, as far as I know, I'm the only one working on it at the time.

So I searched the web for a while, hearing about problems with claims based connection, and using SharePointOnlineCredentials... Yet I'm on a 2010 version, and I don't have access to this class.

Here's the snippet I use to connect (with the "most popular" MsOnlineClaimsHelper):

this.user = user;
this.password = password;
this.siteHttps = siteHttps;
claimsHelper = new MsOnlineClaimsHelper(this.siteHttps, this.user, this.password);
using (context = new ClientContext(this.siteHttps))
{
    context.ExecutingWebRequest += claimsHelper.clientContext_ExecutingWebRequest;
}

Any idea on how to solve this?

For the note, the exception message ends with a "Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()" call.

1条回答
beautiful°
2楼-- · 2019-08-24 16:23

I got it... You just have to check your account on a browser and not in your application, because the password has probably expired.

查看更多
登录 后发表回答