我使用mvc客户端按照教程构建了一个IdentityServer。http://identityserver.github.io/Documentation/docs/overview/simplestOAuth.html IdentityServer在mvc客户端上工作得很好,但我使用的是javascript客户端,所以我下载了javascript示例: Javscript隐式客户端:https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/Clients/JavaScriptImplicitClient
当我尝试从客户端登录时,总是返回“客户端应用程序未知或未经授权”的信息。
谁能给我指个方向?有没有办法打开日志记录来查看客户端被拒绝的原因?
相关javascript代码:
var config = {
authority: "https://localhost:44302/identity",
client_id: "mws",
redirect_uri: window.location.protocol + "//" + window.location.host + "/index.html",
post_logout_redirect_uri: window.location.protocol + "//" + window.location.host + "/index.html",
// these two will be done dynamically from the buttons clicked
//response_type: "id_token token",
//scope: "openid profile email read write",
// we're not using these in this sample
silent_redirect_uri: window.location.protocol + "//" + window.location.host + "/silent_renew.html",
//silent_renew: true,
// this will allow all the OIDC protocol claims to vbe visible in the window. normally a client app
// wouldn't care about them or want them taking up space
filter_protocol_claims: false
};服务器端客户端定义:
new Client
{
Enabled = true,
ClientName = "Manager Workstation",
ClientId = "mws",
Flow = Flows.Hybrid,
RequireConsent = true,
RedirectUris = new List<string>
{
"https://localhost:44303/index.html"
},
PostLogoutRedirectUris = new List<string>
{
"https://localhost:44303/index.html"
}
}, ...发布于 2015-05-22 02:55:49
我让它起作用了。问题出在服务端,它的"Flow = Flows.Hybrid“应该是"Flow = Flows.Implicit”。
发布于 2015-09-15 14:19:06
我看到了同样的错误,因为没有在客户端和服务器端定义作用域。我已经将我的解决方案添加到了这篇文章中:Thinktecture Identity server v3 Google provider
https://stackoverflow.com/questions/30375415
复制相似问题