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)
)Content copied to clipboard
iOS:
let params = B2BSessionsAuthenticateParameters(sessionDurationMinutes: 30)
let response = try await StytchB2B.sessions.authenticate(params)Content copied to clipboard
React Native:
StytchB2B.sessions.authenticate({ sessionDurationMinutes: 30 })Content copied to clipboard
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.