Sharepoint API Python Office365的身份验证错误-KeyError:“ FedAuth”

问题描述

我正在尝试使用以下代码连接到Sharepoint并获取KeyError:“ FedAuth”。 我的目标是通过API访问在线Sharepoint,以读取一些xlsx文件。 我尝试了在这里找到的所有打开/关闭主题,但是每次都会遇到相同的错误

@Component
@requiredArgsConstructor
@Slf4j
public class RabbitMQConsumer {

    private final MessageAction postProcessAction;
    private final ComponentService componentService;
    private final Coercion coercion;

    @RabbitListener(queues = "${spring.rabbitmq.queueName}",containerFactory = "directRabbitListenerContainerFactory")
    public void listen(@Payload MyObject in) {
        ///do something
    }
#import all the libraries
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.files import file

#target url taken from sharepoint and credentials
ctx_auth = AuthenticationContext(url)
if ctx_auth.acquire_token_for_user(username,password):
  ctx = ClientContext(url,ctx_auth)
  web = ctx.web
  ctx.load(web)
  ctx.execute_query()
  print("Authentication successful")

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)