首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Identityserver3 -客户端应用程序不知道或未授权

Identityserver3 -客户端应用程序不知道或未授权
EN

Stack Overflow用户
提问于 2016-08-02 18:32:25
回答 2查看 2.8K关注 0票数 0

我正在设置我的客户端应用程序port3g以使用IdentityServer3进行身份验证。

我收到了错误:客户端应用程序是未知的或没有授权的。,我认为我的客户端和OAuth服务器客户端设置都配置正确。有没有人在这两种配置中看到错误?

网站: PORT3G StartUp .

代码语言:javascript
复制
   public void ConfigureAuth(IAppBuilder app)
    {
        JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();

        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
        });
        //port3g_implicit


        app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
        {
            ClientId = "port3g_implicit",  
            Authority = "http://localhost:22710",  // Authorization Server
            RedirectUri = "http://localhost:28037/",  // Address of this website
            ResponseType = "id_token token ",  // Added token was not in orginal code
            Scope = "openid profile offline_access read appRoles",
            PostLogoutRedirectUri = "http://localhost:28037",
            SignInAsAuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
        });

    }

网站: Webhost.OAuth

代码语言:javascript
复制
// BEGIN PORT3G
            new Client
            {
                ClientId = "port3g_implicit",  
                ClientSecrets = new List<Secret>
                {
                    new Secret("secret".Sha256())
                },
                ClientName = "Port3G", 
                Flow = Flows.Implicit,
                AllowedScopes = new List<string>
                {
                    Constants.StandardScopes.OpenId,
                    Constants.StandardScopes.Profile,Constants.StandardScopes.AllClaims ,
                   "read","appRoles"
                },
                RedirectUris = new List<string>
                {
                    "http://localhost:28037/",
                     "http://localhost:28037/"
                },
                PostLogoutRedirectUris = new List<string>
                {
                    "http://localhost:28037/"
                },
                Enabled = true
            }
            // END PORT3G
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-08-03 11:04:07

在响应类型的末尾有一个空格。

代码语言:javascript
复制
 ResponseType = "id_token token ",  // Added token was not in orginal code

把它移开试试。还移除offline_access范围

票数 1
EN

Stack Overflow用户

发布于 2016-08-03 00:02:21

你打开IdentityServer测井了吗?这对于诊断这类问题是非常有帮助的。

在这种特殊情况下,可能是因为您请求的是隐式流不允许的offline_access。尝试从分配给作用域的字符串中移除该标识符。当您打开日志记录时,您可能会看到下面的一行,它指出了这个问题:

不允许错误请求范围:"offline_access“

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

https://stackoverflow.com/questions/38728015

复制
相关文章

相似问题

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