0
我想通過授權碼流從Token端點獲得「access_token」和「id_token」。但是,在postman上使用以下參數調用令牌端點時,出現「invalid_grant」錯誤。如何通過authorization_code流從IdentityServer4的TokenEndpoint獲取id_token?
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發送成功的發佈請求?