Skip to content

Credentials

Defines credentials related schemas.

OAuthCredentials

Bases: BaseModel

Defines OAuth credentials for MCP connectors.

Sensitive fields are masked on access and serialization. Use .get_secret_value() only when the raw value is required.

Attributes:

Name Type Description
client_id SecretStr

The client ID (masked on access).

client_secret SecretStr

The client secret (masked on access).

refresh_token SecretStr

The refresh token (masked on access).

get_access_token() async

Gets the access token.

This method checks if the access token is expired or expiring and refreshes it if necessary, then returns the access token. Concurrent callers are serialized so only one refresh runs at a time.

Returns:

Name Type Description
str str

The access token.