diff --git a/fastapi_keycloak/model.py b/fastapi_keycloak/model.py index 67289a4..9806baa 100644 --- a/fastapi_keycloak/model.py +++ b/fastapi_keycloak/model.py @@ -206,9 +206,11 @@ class KeycloakToken(BaseModel): Attributes: access_token (str): An access token + refresh_token (str): An a refresh token, default None """ access_token: str + refresh_token: Optional[str] = None def __str__(self): """String representation of KeycloakToken""" diff --git a/tests/coverage.xml b/tests/coverage.xml index e69de29..8db991e 100644 --- a/tests/coverage.xml +++ b/tests/coverage.xml @@ -0,0 +1,473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_functional.py b/tests/test_functional.py index c3b2e8c..fa285f5 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -426,9 +426,10 @@ def test_user_groups(self, idp, user): ) def test_login_exceptions(self, idp, action, exception, user): - # Get access tokens for the users - access_token = idp.user_login(username=user.username, password=TEST_PASSWORD) - assert access_token + # Get access and refresh for the users + tokens = idp.user_login(username=user.username, password=TEST_PASSWORD) + assert tokens.access_token + assert tokens.refresh_token user.requiredActions.append(action) # Add an action user: KeycloakUser = idp.update_user(user=user) # Save the change