Oauth 刷新keydape脱机令牌

Oauth 刷新keydape脱机令牌,oauth,oauth-2.0,postman,keycloak,Oauth,Oauth 2.0,Postman,Keycloak,我目前正试图获得一个离线令牌与KeyClope一起工作。我的问题是,我无法刷新我曾经获得的令牌 当我最初调用令牌端点时,我得到了一个具有工作访问令牌的正确响应: { "access_token": "<access-token>", "expires_in": 900, "refresh_expires_in": 0, "refresh_token": "<refresh-token>", "token_type": "bearer", "not-

我目前正试图获得一个离线令牌与KeyClope一起工作。我的问题是,我无法刷新我曾经获得的令牌

当我最初调用令牌端点时,我得到了一个具有工作访问令牌的正确响应:

{
  "access_token": "<access-token>",
  "expires_in": 900,
  "refresh_expires_in": 0,
  "refresh_token": "<refresh-token>",
  "token_type": "bearer",
  "not-before-policy": 1539890980,
  "session_state": "a178faf2-xxxx-xxxx-xxxx-fb16548b6805",
  "scope": "email profile offline_access"
}

我看了《钥匙斗篷》和《吉拉》的问题,这似乎不是一个已知的问题。有人能帮我运行离线令牌吗?有什么特别的把戏吗?谢谢你的帮助

确保您的域设置对于脱机会话的值大于0。它们的生存期与正常会话不同

默认情况下,我认为它设置为30天,但只需再次检查

然后检查领域设置,查看是否也允许重复使用刷新令牌。如果禁用了令牌的重复使用,请确保不会多次使用刷新令牌


如果停止重复使用,那么我现在想不起来什么。我只在令牌过期时看到你的错误

谢谢你的回答-我再次查看了领域设置,发现了错误。我不知何故将“离线会话空闲”设置为9999天(2046年),尽管过高,但似乎会导致2038年的问题。值越低越好!
curl -X POST \
  https://<my-url>/auth/realms/<realm>/protocol/openid-connect/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -d 'client_id=<client-id>
  -d 'refresh_token=<refresh-token>
  -d 'grant_type=refresh_token'
{
  "error": "invalid_grant",
  "error_description": "Offline session not active"
}