通过Microsoft Graph API获取OneDrive for Business站点ID时遇SSL证书验证失败问题求助
通过Microsoft Graph API获取OneDrive for Business站点ID时遇SSL证书验证失败问题求助
我现在正卡在通过Microsoft Graph API获取OneDrive链接对应的站点ID这件事上,想请大家帮忙看看问题出在哪。
我的OneDrive链接是:https://sharedspace-my.sharepoint.com/:f:/r/personal/naruto/Documents/Shared%20Folders/hinata?csf=1&web=1&e=M3GWjd
我从这个链接里提取了以下信息:
- HOST =
sharedspace-my.sharepoint.com - SITE_URL =
/personal/naruto/Documents/Shared%20Folders/hinata
目前我已经成功获取到了访问令牌(access token),权限也确认过是可访问的,但当我尝试调用API获取站点ID时,却遇到了这个SSL证书验证错误:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)
下面是我使用的代码片段:
auth_url = f'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token' data = { 'client_id': client_id, 'scope': 'files.readwrite.all', 'username': username, 'password': password, 'grant_type': 'password', 'response_type': 'code', 'client_secret': client_secret } # 后续调用获取站点ID的API代码(比如GET /sites/{host}:/{site-url})
有没有朋友遇到过类似的问题?或者能给我一些排查的方向?
备注:内容来源于stack exchange,提问作者JSVJ
相关产品推荐
相关产品推荐

