javascript - IdentityServer3隐式流程不支持javascript

标签 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 客户端重定向到 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 Error 405.0 - Method Not Allowed

最佳答案

尝试以下设置:

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 - IdentityServer3隐式流程不支持javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40629892/

相关文章:

javascript - hello.js:是否可以动态设置提供程序的设置?

c# - IdentityServer启用引用 token

c# - 在 Microsoft.Owin.Security.OpenIdConnect 中间件的响应中添加位置 header

javascript - Transform 不适用于 jQuery .animate()

javascript - CSS 子菜单未显示在主菜单下

java - 如何使用 Java 命令行应用程序对 https ://tfspreview. com(MIcrosoft 托管的 TFS)进行身份验证?

identityserver3 - 如何使用 IdentityServer3 通过 javascript 传递我的访问 token ?

javascript - Angular4 - 我需要取消订阅 setTimeout 调用吗?

javascript - 无法读取未定义的属性 '_babelPolyfill'

oauth-2.0 - Apache Syncope 与 OAuth 2