Skip to content

common_auth.schemas.sessions.oauth

HTTP-dependent authorization-code login configuration.

Classes

OAuthSessionConfig

Bases: _SessionConfig

OAuth authorization-code login settings for browser or manual completion.

URLs retain exact spelling. authorize_url accepts HTTP(S); redirect_uri also supports native private-use schemes. Deployment chooses trusted endpoints and registered callback addresses; construction establishes no such trust.

PKCE defaults to S256. None is an explicit compatibility choice, never an automatic retry/downgrade. Runtime always generates and checks transaction state, binds completion to the initiating caller and consumes it once within authorization_ttl_sec. Codes, state, verifiers and nonces are private operation state, not reusable config. Manual completion obeys the same checks.

The injected exchange must agree on issuer/client/grant and use the exact redirect URI and original verifier. Browser navigation and token publication are injected. This config implements neither OIDC ID-token verification nor any provider’s UI workflow.

provider_fields names parameters a provider adds to its callback beyond OAuth’s own, such as Intuit’s realmId (the company the person connected). The login reads them with provider_values(); every other unknown callback parameter stays ignored. They cannot reuse OAuth’s names or the registered redirect query’s.

Fields and properties declared here; inherited members belong to the bases above.

authorization_ttl_sec

authorization_ttl_sec: float = Field(default=600.0, gt=0, allow_inf_nan=False)

authorize_url

authorize_url: URL = Field(repr=False)

client_id

client_id: ClientId

grant

grant: GrantRef

issuer

issuer: IssuerId

pkce_method

pkce_method: Literal['S256'] | None = 'S256'

provider_fields

provider_fields: frozenset[str] = Field(default=(frozenset()), strict=False)

redirect_uri

redirect_uri: str = Field(repr=False)

scopes

scopes: ScopeSet | None = None