首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法从JavaScript客户端访问Thinktecture IdentityServer3上的登录

无法从JavaScript客户端访问Thinktecture IdentityServer3上的登录
EN

Stack Overflow用户
提问于 2015-05-21 21:38:30
回答 2查看 2.5K关注 0票数 3

我使用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代码:

代码语言: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
    };

服务器端客户端定义:

代码语言:javascript
复制
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"
                }
            }, ...
EN

回答 2

Stack Overflow用户

发布于 2015-05-22 02:55:49

我让它起作用了。问题出在服务端,它的"Flow = Flows.Hybrid“应该是"Flow = Flows.Implicit”。

票数 2
EN

Stack Overflow用户

发布于 2015-09-15 14:19:06

我看到了同样的错误,因为没有在客户端和服务器端定义作用域。我已经将我的解决方案添加到了这篇文章中:Thinktecture Identity server v3 Google provider

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30375415

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档