Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion workos/types/user_management/authentication_response.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from typing import Literal, Optional, TypeVar

from workos.types.user_management.impersonator import Impersonator
from workos.types.user_management.oauth_credentials import OauthCredentials
from workos.types.user_management.user import User
from workos.types.workos_model import WorkOSModel


AuthenticationMethod = Literal[
"SSO",
"Password",
Expand All @@ -27,6 +28,7 @@ class AuthenticationResponse(_AuthenticationResponseBase):
authentication_method: Optional[AuthenticationMethod] = None
impersonator: Optional[Impersonator] = None
organization_id: Optional[str] = None
oauth_credentials: Optional[OauthCredentials] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will OAuth credentials exist for all authentication methods or just authenticate with code?

user: User


Expand Down
19 changes: 19 additions & 0 deletions workos/types/user_management/oauth_credentials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import Literal, List
from workos.types.workos_model import WorkOSModel

OauthCredentialProviders = Literal[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nit naming suggestion for type

Suggested change
OauthCredentialProviders = Literal[
OauthCredentialProviderType = Literal[

"AppleOauth",
"GitHubOauth",
"GoogleOauth",
"MicrosoftOauth",
]


class OauthCredentials(WorkOSModel):
"""Representation of a Oauth credentials"""

provider: OauthCredentialProviders
access_token: str
refresh_token: str
expires_at: int
scopes: List[str]
Loading