我正在尝试使用我的OneDrive与Python做生意。
我已经安装了一个驱动程序my,现在我正在验证我的OneDrive
提供的代码如下
import onedrivesdk
redirect_uri = 'http://localhost:8080/'
client_secret = 'your_client_secret'
client_id='your_client_id'
api_base_url='https://api.onedrive.com/v1.0/'
scopes=['wl.signin', 'wl.offline_access', 'onedrive.readwrite']
http_provider = onedrivesdk.HttpProvider()
auth_provider = onedrivesdk.AuthProvider(
http_provider=http_provider,
client_id=client_id,
scopes=scopes)
client = onedrivesdk.OneDriveClient(api_base_url, auth_provider, http_provider)
auth_url = client.auth_provider.get_auth_url(redirect_uri)我不确定我应该提供什么client_secret和client_id来访问我的OneDrive
我将感谢从哪里获得上述参数的帮助。
发布于 2017-07-15 06:08:55
client_secret和client_id是使用OAuth2必需的两个参数,后者是一种用于授权的行业标准协议。
请查看以下链接,了解如何获取这些与OneDrive访问相关的信息:
https://dev.onedrive.com/auth/msa_oauth.htm
Get Access Token with OneDrive API
您需要通过以下链接注册应用程序:https://dev.onedrive.com/app-registration.htm
在此之后,您的应用程序将收到一些请求,并使用有效的用户凭据访问OneDrive帐户。
我希望它能帮上忙。
https://stackoverflow.com/questions/45112152
复制相似问题