Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Add scope to login_uri
Browse files Browse the repository at this point in the history
Also `id_token` field has been added to KeycloakToken model
  • Loading branch information
odnobit committed Jan 24, 2024
1 parent 9949e94 commit 3006ce7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions fastapi_keycloak/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ def _admin_request(
def login_uri(self):
"""The URL for users to login on the realm. Also adds the client id and the callback."""
params = {
"scope": "openid profile email",
"response_type": "code",
"client_id": self.client_id,
"redirect_uri": self.callback_uri,
Expand Down
2 changes: 2 additions & 0 deletions fastapi_keycloak/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@ class KeycloakToken(BaseModel):
Attributes:
access_token (str): An access token
refresh_token (str): An a refresh token, default None
id_token (str): An issued by the Authorization Server token id, default None
"""

access_token: str
refresh_token: Optional[str] = None
id_token: Optional[str] = None

def __str__(self):
"""String representation of KeycloakToken"""
Expand Down

0 comments on commit 3006ce7

Please sign in to comment.