mariovalney / laravel-keycloak-web-guard

Simple Keycloak Guard to Laravel Web Routes - https://packagist.org/packages/vizir/laravel-keycloak-web-guard
146 stars 80 forks source link

How to Refresh access token using keycloak web guard. #28

Closed sumit290785 closed 4 years ago

sumit290785 commented 4 years ago

Do package have any controller action which refresh access token using refresh token so i can use than action as ajax callback for refreshing session and keycloak token. thanks

mariovalney commented 4 years ago

Refresh token is refreshed seamless.

We store the access_token and the refresh_token. When access_token is expired, we refresh it before getting userinfo again.

Anyway, I guess you can try:

$credentials = KeycloakWeb::retrieveToken();
KeycloakWeb::refreshAccessToken($credentials);