Authentication
Authentication functions and utilities.
Main Functions
- idtap.login_google(base_url: str = 'https://swara.studio/', storage: SecureTokenStorage | None = None, host: str = 'localhost', port: int = 8080) Dict[str, Any][source]
Authenticate with Google via the Swara server and store token/profile information.
This function implements a server-based OAuth flow where the Python client redirects to the Swara server’s OAuth endpoints instead of directly to Google. This is more secure as OAuth credentials are only stored on the server.
- Parameters:
base_url – Swara Studio API base URL.
storage – SecureTokenStorage instance for storing tokens. If None, creates a new one.
host – Local host for OAuth redirect.
port – Local port for OAuth redirect.
- Returns:
The user document returned by the Swara API, including the
_idfield assigned by the server.
Authentication Utilities
Secure Storage
The secure storage module handles safe storage of OAuth tokens across different platforms.