python-keycloak
python-keycloak copied to clipboard
Token session expired
trafficstars
My script use KeycloakAdmin. After it run 30 minutes, the script occurs an error as bellow:
File "/sa/python_root/python3_django196/lib/python3.5/site-packages/keycloak/exceptions.py", line 108, in raise_error_from_response response_body=response.content) keycloak.exceptions.KeycloakAuthenticationError: 401: b'{"error":"HTTP 401 Unauthorized"}'
Seem as, the Keycloak token has expired. How can I resolved it?
Sounds like the session timed out. Using keycloak_admin.refresh_token() should help (before the timeout)...
possible duplicate of #36