IdentityServer3隐式流不是javascript的

时间:2016-11-16 10:35:31

标签: javascript oauth-2.0 identityserver3

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

   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 clints重定向到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 - 不允许的方法

1 个答案:

答案 0 :(得分: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";