B2BSessionsClient

B2B session management methods.

Functions

Link copied to clipboard
abstract suspend fun attest(request: IB2BSessionsAttestParameters): B2BSessionsAttestResponse

Attests the current member session using a Stytch Trusted Auth Token. Calls the POST /sdk/v1/b2b/sessions/attest endpoint.

Link copied to clipboard
abstract suspend fun authenticate(request: IB2BSessionsAuthenticateParameters): B2BSessionsAuthenticateResponse

Validates the current member session token against the Stytch backend and optionally extends the session. Calls the POST /sdk/v1/b2b/sessions/authenticate endpoint.

Link copied to clipboard
abstract suspend fun exchange(request: IB2BSessionsExchangeParameters): B2BSessionsExchangeResponse

Exchanges the current member session for a session in a different organization. Calls the POST /sdk/v1/b2b/sessions/exchange endpoint. The member must belong to the target organization.

Link copied to clipboard
abstract suspend fun exchangeAccessToken(request: IB2BSessionsAccessTokenExchangeParameters): B2BSessionsAccessTokenExchangeResponse

Exchanges the current member session for an OAuth access token for a connected provider. Calls the POST /sdk/v1/b2b/sessions/exchange_access_token endpoint.

Link copied to clipboard
abstract suspend fun revoke(): B2BSessionsRevokeResponse

Revokes the current member session, signing the member out on the backend and clearing local session state. Calls the POST /sdk/v1/b2b/sessions/revoke endpoint.