Skip to content

Commit

Permalink
fix: unconditionally refresh api token in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
smlx authored and Toby Bellwood committed Feb 23, 2021
1 parent a69ed2a commit fe286f3
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions tests/tasks/api/refresh_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@

access_token = jwt.decode(grant['access_token'], verify=False)

current_time = int(time.time())

if current_time < access_token['exp']:
print grant_raw
else:
data = {'client_id': 'auth-server',
'client_secret': auth_server_client_secret,
'grant_type': 'refresh_token',
'refresh_token': grant['refresh_token']}

r = requests.post(url = "http://keycloak:8080/auth/realms/lagoon/protocol/openid-connect/token", data = data)
print r.text
data = {'client_id': 'auth-server',
'client_secret': auth_server_client_secret,
'grant_type': 'refresh_token',
'refresh_token': grant['refresh_token']}

r = requests.post(url = "http://keycloak:8080/auth/realms/lagoon/protocol/openid-connect/token", data = data)
print r.text

0 comments on commit fe286f3

Please sign in to comment.