401使用SharePoint CSOM ClientContext和OAuth的未经授权的错误

编程入门 行业动态 更新时间:2024-10-27 07:24:48
本文介绍了401使用SharePoint CSOM ClientContext和OAuth的未经授权的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

尝试从winforms应用程序向SharePoint Online(通过ClientContext)进行CSOM调用时遇到问题。我的环境具有与Office 365通信的Active Directory联合身份验证服务服务器。

I have been having problems attempting to make CSOM calls to SharePoint Online (via ClientContext) from a winforms application. My environment has an Active Directory Federation Services Server in communication with Office 365.

我正在使用ClientId,Client Secret和TenantId创建ClientContext;换言之,高信任情景。我一直在使用Fiddler观察消息流量。

I am creating a ClientContext using the an ClientId, Client Secret and TenantId ; in other words a high trust scenario. I've been using Fiddler to watch message traffic.

创建上下文时,我按预期收到了一个Bearer令牌。但是每当我使用上下文进行呼叫时,我都会收到401个未经授权的响应以及一些额外的错误消息:

When creating the context I receive a Bearer token as expected. However whenever I make a call using the context I keep getting 401 Unauthorized responses with some additional error messaging :

x-ms-diagnostics:3000006; reason =" Token contains无效签名";类别"invalid_client"

x-ms-diagnostics: 3000006;reason="Token contains invalid signature"; category"invalid_client"

响应正文显示"不支持的安全令牌"。

the body of the response says "Unsupported security token".

事情就是这一切都正常几个星期前,在新的一年之前,它突然停止工作,我一直无法找出原因。

The thing of it is this was all working fine several weeks ago, before the new year, and all of a sudden it stopped working and I've been unable to figure out why.

谢谢

推荐答案

尝试检查加载项密钥是否已过期。

applist = Get-MsolServicePrincipal -all | Where-Object -FilterScript {( applist = Get-MsolServicePrincipal -all |Where-Object -FilterScript { (

_。DisplayName-notlike" * Microsoft *") - 和( _.DisplayName -notlike "*Microsoft*") -and (

更多推荐

401使用SharePoint CSOM ClientContext和OAuth的未经授权的错误

本文发布于:2023-11-09 22:40:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573628.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:未经授权   错误   SharePoint   CSOM   OAuth

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!