authenticate

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.

Kotlin:

StytchB2B.sessions.authenticate(
B2BSessionsAuthenticateParameters(sessionDurationMinutes = 30)
)

iOS:

let params = B2BSessionsAuthenticateParameters(sessionDurationMinutes: 30)
let response = try await StytchB2B.sessions.authenticate(params)

React Native:

StytchB2B.sessions.authenticate({ sessionDurationMinutes: 30 })

Return

B2BSessionsAuthenticateResponse containing the validated member session.

Parameters

request
  • IB2BSessionsAuthenticateParameters

  • sessionDurationMinutes? — If provided, extends the session by this many minutes from now.

Throws

StytchError

if the session token is invalid or expired.

if the coroutine is cancelled.