需要帮助集成onedrive与php web应用程序 . 目前我在执行以下操作时遇到困难: -
-
我正在关注这个“https://docs.microsoft.com/en-us/onedrive/developer/”doc来整合它 .
-
首先通过我的帐户“https://login.microsoftonline.com”在"Microsoft Application Registration Portal"注册了我的应用 . 在那里它询问了关于我的应用程序的一些细节 - >重定向url和我生成的客户端ID和客户端Secrete在使用onedrive API时将需要它 .
-
在身份验证过程中,我遵循Microsoft Graph - >代码流程 .
-
Made API调用“GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id= &scope = &response_type = code&redirect_uri = ". Specified the required details and i got proper response. i.e " https://myapp.com/auth-redirect?code=df6aa589-1080-b241-b410-c4dff65dbf7c”我从中获得了代码 .
-
Now using this code i have to get Access token in which i am failing. 因此,我正在进行文档中提到的API调用 . 即“POST https://login.microsoftonline.com/common/oauth2/v2.0/token Content-Type:application / x-www-form-urlencoded
client_id = &redirect_uri = &client_secret = &code = &grant_type = authorization_code“
上面我传递了我在创建应用程序时生成的相同客户端秘密 . 但我仍然没有获得Access令牌而是收到响应: -
{“error”:“invalid_client”,“error_description”:“AADSTS70002:验证凭据时出错.AADSTS50012:提供了无效的客户端密码...}
I tried few other option also like regenerating the new secret key and also urlencoding but was of no use. 请帮助我,因为我无法从这里前进 . Thanks in advance for help.
1 回答
想出了问题 . 基本上问题是 secret key generated . 在 "Microsoft Application Registration Portal" 我们注册我们的应用程序,在生成应用程序秘密时,我使用"Generate New key pair"选项生成sceret而不是我们必须使用通过单击其他选项 "Generate New Password" 生成的秘密 .