Skip to content

Commit

Permalink
Reduce access token lifespan
Browse files Browse the repository at this point in the history
  • Loading branch information
nuwang committed Nov 3, 2023
1 parent 0f79dc0 commit 0e01b93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/integration/oidc/galaxy-realm-export.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"defaultSignatureAlgorithm" : "RS256",
"revokeRefreshToken" : false,
"refreshTokenMaxReuse" : 0,
"accessTokenLifespan" : 10,
"accessTokenLifespan" : 6,
"accessTokenLifespanForImplicitFlow" : 900,
"ssoSessionIdleTimeout" : 1800,
"ssoSessionMaxLifespan" : 36000,
Expand Down
6 changes: 3 additions & 3 deletions test/integration/oidc/test_auth_oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ def test_auth_with_expired_token(self):
access_token = self._get_keycloak_access_token()
response = self._get("users/current", headers={"Authorization": f"Bearer {access_token}"})
self._assert_status_code_is(response, 200)
# token shouldn't expire in 4 seconds, so the call should succeed
time.sleep(4)
# token shouldn't expire in 3 seconds, so the call should succeed
time.sleep(3)
response = self._get("users/current", headers={"Authorization": f"Bearer {access_token}"})
self._assert_status_code_is(response, 200)
# token should have expired in 10 seconds, so the call should fail
# token should have expired in 7 seconds, so the call should fail
time.sleep(7)
response = self._get("users/current", headers={"Authorization": f"Bearer {access_token}"})
self._assert_status_code_is(response, 400)
Expand Down

0 comments on commit 0e01b93

Please sign in to comment.