【发布时间】:2017-05-19 21:05:02
【问题描述】:
我想通过授权码流从令牌端点获取“access_token”和“id_token”。但是,在邮递员上使用以下参数调用令牌端点时出现“invalid_grant”错误。
POST /connect/token HTTP/1.1
Host: localhost:2000
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Postman-Token: a8a29659-0ea3-e7dc-3bd6-6e6630a7370d
client_id=client
&client_secret=client
&grant_type=authorization_code
&username=admin
&password=admin
&scope=openid+profile
客户端配置:
new Client
{
ClientId = "client",
ClientSecrets =
{
new Secret("client".Sha256())
},
AllowedGrantTypes = new List<string> { OidcConstants.GrantTypes.AuthorizationCode },
AllowedScopes = {
StandardScopes.OpenId.Name,
StandardScopes.Profile.Name,
}
}
我的客户端配置部分有什么问题?以及,如何向 Token Endpoint 发出成功的 post 请求?
【问题讨论】:
标签: asp.net-core openid-connect identityserver4