我正在设置我的客户端应用程序port3g以使用IdentityServer3进行身份验证。
我收到了错误:客户端应用程序是未知的或没有授权的。,我认为我的客户端和OAuth服务器客户端设置都配置正确。有没有人在这两种配置中看到错误?
网站: PORT3G StartUp .
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
// 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发布于 2016-08-03 11:04:07
在响应类型的末尾有一个空格。
ResponseType = "id_token token ", // Added token was not in orginal code把它移开试试。还移除offline_access范围
发布于 2016-08-03 00:02:21
你打开IdentityServer测井了吗?这对于诊断这类问题是非常有帮助的。
在这种特殊情况下,可能是因为您请求的是隐式流不允许的offline_access。尝试从分配给作用域的字符串中移除该标识符。当您打开日志记录时,您可能会看到下面的一行,它指出了这个问题:
不允许错误请求范围:"offline_access“
https://stackoverflow.com/questions/38728015
复制相似问题