Rai*_*nod 6 java oauth-2.0 vert.x keycloak
如果用户的access_token过期并且用户想要继续登录,我需要让用户继续登录系统.如何在Keycloak上使用refresh_token获取新更新的access_token ?
我使用vertx-AUTH与在auth实施Keycloak上vert.x.是否可以使用vertx-auth或Keycloak的REST API本身刷新access_token ?或者这将是另一种实现方式?
Yog*_*hra 26
keycloak具有用于创建access_token使用的REST API refresh_token.它是一个POST endpoint with application/x-www-form-urlencoded
以下是它的外观:
Method: POST
URL: https://keycloak.example.com/auth/realms/myrealm/protocol/openid-connect/token
Body type: x-www-form-urlencoded
Form fields:
client_id : <my-client-name>
grant_type : refresh_token
refresh_token: <my-refresh-token>
这将使用刷新令牌为您提供新的访问令牌.
注意:如果刷新令牌已过期,则会抛出400异常,因为您可以再次登录用户.
查看Postman中的示例,您可以使用此开发和相应的API.