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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
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 |
|
|
|