【问题标题】:IdentityServer3 implicit flow not wokred javascriptIdentityServer3 隐式流未工作 javascript
【发布时间】:2016-11-16 10:35:31
【问题描述】:

我有一个具有隐式流程的客户端配置。

   new Client
   {
       Enabled = true,
       ClientId = "implicit",
       ClientName = "Implicit Grant Flow",
       Flow = Flows.Implicit,
       RedirectUris = new List<string>
       {
              "http://localhost:24678/callback.html",
       },
       AllowedScopes = new List<string>
       {
              Constants.StandardScopes.OpenId
       }
   }

我想将我的 javascript 客户端重定向到 IdentityServer3 登录页面。

        var url = "http://localhost:4751/connect/authorize"
            + "?client_id=" + ("implicit")
            + "&redirect_uri=" + encodeURIComponent("http://localhost:24678/callback.html")
            + "&response_type=" + ("token")
            + "&response_mode=" + ("form_post")
            + "&scope=" + ("openid");

但是发生了错误:

HTTP 错误 405.0 - 方法不允许

【问题讨论】:

  • 如果您在服务器端开启日志记录,很可能会显示答案。

标签: javascript oauth-2.0 identityserver3


【解决方案1】:

尝试以下设置:

var url = "http://localhost:4751/connect/authorize"
        + "?client_id=" + ("implicit")
        + "&redirect_uri=" + encodeURIComponent("http://localhost:24678/callback.html")
        + "&response_type=" + ("id_token")
        + "&response_mode=" + ("fragment")
        + "&scope=" + ("openid")
        + "&nonce=none";

【讨论】:

  • 这行得通。但我可以在任何地方看到这个参数描述。
  • 好吧,隐式流是 javascript 应用程序类型的最佳解决方案。
猜你喜欢
  • 1970-01-01
  • 2016-06-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多