【发布时间】:2017-05-19 02:16:44
【问题描述】:
这个问题实际上是我的this SO question的一个连续问题。我正在尝试使用授权代码流从 Identityserver4 获取 access_token 和 id_token。
但是,如果我尝试访问“授权”端点,则会收到 405(不允许方法)HTTP 错误。
HTTP GET 请求
http://localhost:2000/connect/authorize?
client_id=client
&client_secret=secret
&grant_type=authorization_code
&username=admin
&password=admin
&response_type=id_token+token
&scope=openid+profile+offline_access
客户:
new Client
{
ClientId = "client",
ClientSecrets = { new Secret("secret".Sha256())},
AllowedGrantTypes = new List<string> { "authorization_code" },
AccessTokenType = AccessTokenType.Jwt,
AllowedScopes = { StandardScopes.OpenId.Name, "api1" }
}
用户:
new InMemoryUser
{
Subject = "1",
Username = "admin",
Password = "admin"
}
我的问题是,如何调用授权端点来获取 access_token 和 id_token?我的“客户端”和“用户”配置有什么问题?
【问题讨论】:
-
您是否启用了日志记录?这将帮助您发现许多配置问题。
标签: asp.net-core-1.0 openid-connect identityserver4