【发布时间】:2020-02-07 17:36:04
【问题描述】:
我正在尝试使用 ClientOAuth2.Token.refresh() 刷新 oauth2 令牌,但有时会不断收到错误消息:
{"error":"invalid_grant","error_description":"Session not active"}
这是我被 Fiddler 捕获的请求
POST [URL]= HTTP/1.1
Host: [URL]
Connection: keep-alive
Content-Length: 2250
Accept: application/json, application/x-www-form-urlencoded
Origin: http://localhost:8080
Authorization: Basic YXNpbW92LWRldi1laGlzLXdlYjo=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
Sec-Fetch-Mode: cors
Content-Type: application/x-www-form-urlencoded
Sec-Fetch-Site: cross-site
Referer: http://localhost:8080/
Accept-Encoding: gzip, deflate, br
Accept-Language: en,vi;q=0.9,de;q=0.8,vi-VN;q=0.7,en-US;q=0.6,en-AU;q=0.5
refresh_token=[token]&grant_type=refresh_token
可能是我在 KeyCloak 帐户上的设置有问题。有什么建议吗?
【问题讨论】:
标签: oauth-2.0 keycloak openid-connect refresh-token