【问题标题】:microsoft oauth2 v2.0 redirect_uri is not validmicrosoft oauth2 v2.0 redirect_uri 无效
【发布时间】:2016-08-12 20:47:01
【问题描述】:

我正在尝试关注this guide,以便我可以对我的 OneDrive 帐户进行身份验证,但我收到以下错误:

为输入参数“redirect_uri”提供的值不是 有效的。期望值为 'https://login.live.com/oauth20_desktop.srf' 或匹配的 URL 为此客户端应用程序注册的重定向 URI。

我采取的步骤:

  1. 注册了一个新应用
  2. 给它起个名字
  3. 选择网络平台
  4. 指定https://localhost作为重定向URI
  5. 按下保存键
  6. 创建了这个网址:https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=d0adff4f-bcae-4a69-80a7-8a3328a6cf89&scope=openid+profile&response_type=id_token&redirect_uri=https://localhost&nonce=49458204719374587149482
  7. 将网址粘贴到浏览器并按下回车
  8. 会出现一个登录页面,其中包含我的应用名称,然后我选择我的帐户进行登录。然后我重定向并显示“redirect_uri”无效消息

知道为什么我没有收到令牌响应吗?

【问题讨论】:

  • 当您在 Azure AD 中创建应用程序时,您将什么指定为 redirect_uri?是https://localhost吗?
  • 是的。我已经为redirect_uri 尝试了几种不同的变体。 localhostlocalhost,甚至部署到一个实时的 azure url
  • 我投票结束这个问题,因为它是一个不涉及编程的客户支持问题。

标签: adal onedrive


【解决方案1】:

尝试https://localhost/somepath 而不是https://localhost 或者您甚至可以使用 http 代替 https,但在 localhost 之后提供一些路径或 html 页面。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-25
    • 2016-12-23
    • 2021-06-29
    • 1970-01-01
    • 2017-09-14
    • 2021-04-03
    • 1970-01-01
    相关资源
    最近更新 更多