Skip to content

oauth_sessions

Classes

OAuthSessionModel

Bases: BaseModel

Model representing an OAuth session.

This model stores information about an active OAuth session, including the provider, tokens, and expiration details.

Attributes

id
id: str

The unique identifier for the OAuth session.

user_id
user_id: str

The ID of the user associated with this session.

provider
provider: str

The OAuth provider name (e.g., 'google', 'microsoft').

token
token: dict

The OAuth tokens.

Dict Fields
  • access_token (str, required): The access token for OAuth authentication
  • refresh_token (str, optional): The refresh token for obtaining new access tokens
  • id_token (str, optional): The ID token containing user identity information
  • expires_at (int, optional): Timestamp when the token expires (epoch)
  • expires_in (int, optional): Duration in seconds until token expires
  • issued_at (int, optional): Timestamp when the token was issued
expires_at
expires_at: int

The timestamp (epoch) when the session/token expires.

created_at
created_at: int

The timestamp (epoch) when the session was created.

updated_at
updated_at: int

The timestamp (epoch) when the session was last updated.