【问题标题】:Onedrive File picker not opening when using authorization code flow使用授权代码流时 Onedrive 文件选择器未打开
【发布时间】:2015-04-10 14:05:40
【问题描述】:

我正在按照Microsoft onedrive documentation 授权代码流向我的用户授予对其 onedrive 文件的访问权限。

我获得了 access_code 并使用 ruby​​ 发送了一个带有 access_code、client_id、clien_secret 的 POST 请求,并获得了 access_token 作为 JSON 响应。

当我尝试将此 access_token,scopes,state,.. 与 My Redirect_url 一起附加以访问 Onedrive 文件选取器时,窗口将关闭。以下是该示例的 URL

 http://MY_REDIRECT_URL/onedrive#access_token=My_access_token&token_type=bearer&expires_in=3600&scope=wl.skydrive%20wl.signin&state=redirect_type%3dauth%26display%3dpage%26request_ts%3d1427963180884%26response_method%3durl%26secure_cookie%3dfalse&user_id=My_USER_ID

当我在授权令牌流中使用相同的 URL 时,它会正确打开文件选择器。 当我检查 wl_auth cookie 值时,它说

 error=invalid_cookie&error_description=The%20'wl_auth'%20cookie%20has%20been%20modified%20incorrectly.%20Ensure%20that%20the%20redirect%20URI%20only%20modifies%20sub-keys%20for%20values%20received%20from%20the%20OAuth%20endpoint.&status=connected

【问题讨论】:

    标签: ruby url oauth-2.0 authorization onedrive


    【解决方案1】:

    错误是我们需要使 URL 与使用授权令牌流时获得的 URL 相同。

    另外,在制作 URL 时,请确保其编码以及 response_type 值应该是 URL 而不是 COOKIE

    【讨论】:

      猜你喜欢
      • 2020-08-11
      • 1970-01-01
      • 2021-10-27
      • 1970-01-01
      • 2011-11-17
      • 2011-04-03
      • 2018-05-04
      • 2014-06-27
      • 2021-05-08
      相关资源
      最近更新 更多