我有一个具有隐式流程的客户端配置。
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/