authenticate
Authenticates an OAuth token received from a deeplink after the browser-based OAuth flow completes. Calls the POST /sdk/v1/oauth/authenticate endpoint. Retrieves the PKCE code verifier stored during the corresponding OAuthType.start call.
This method is called automatically by OAuthType.start when using the browser flow — you typically only need to call it directly if you are handling the deeplink redirect yourself.
Kotlin:
StytchConsumer.oauth.authenticate(
OAuthAuthenticateParameters(token = "token", sessionDurationMinutes = 30)
)iOS:
let params = OAuthAuthenticateParameters(token: "token", sessionDurationMinutes: 30)
let response = try await StytchConsumer.oauth.authenticate(params)React Native:
StytchConsumer.oauth.authenticate({ token: "token", sessionDurationMinutes: 30 })Return
OAuthAuthenticateResponse containing the authenticated session and user.
Parameters
IOAuthAuthenticateParameters
token— The OAuth token extracted from the deeplink URL.sessionDurationMinutes— Duration of the session to create, in minutes.
Throws
if the token is invalid or expired, or if no PKCE verifier is found in storage.
if the coroutine is cancelled.