Browse Source

Merge pull request #99 from happy-river/token-not-active

Handle 'Token is not active' error in refresh_token
pull/116/head
Marcos Pereira 4 years ago
committed by GitHub
parent
commit
c1f5666e20
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      keycloak/keycloak_admin.py

3
keycloak/keycloak_admin.py

@ -1469,7 +1469,8 @@ class KeycloakAdmin:
try:
self.token = self.keycloak_openid.refresh_token(refresh_token)
except KeycloakGetError as e:
if e.response_code == 400 and b'Refresh token expired' in e.response_body:
if e.response_code == 400 and (b'Refresh token expired' in e.response_body or
b'Token is not active' in e.response_body):
self.get_token()
else:
raise

Loading…
Cancel
Save