Passwords

interface Passwords

Passwords interface that encompasses authentication functions as well as other related functionality

Types

Link copied to clipboard
data class AuthParameters(    val email: String,     val password: String,     val sessionDurationMinutes: UInt = DEFAULT_SESSION_TIME_MINUTES)

Data class used for wrapping parameters used with Passwords authentication

Link copied to clipboard
data class CreateParameters(    val email: String,     val password: String,     val sessionDurationMinutes: UInt = DEFAULT_SESSION_TIME_MINUTES)

Data class used for wrapping parameters used with Passwords create endpoint

Link copied to clipboard
data class ResetByEmailParameters(    val token: String,     val password: String,     val sessionDurationMinutes: UInt = DEFAULT_SESSION_TIME_MINUTES)

Data class used for wrapping parameters used with Passwords ResetByEmail endpoint

Link copied to clipboard
data class ResetByEmailStartParameters(    val email: String,     val loginRedirectUrl: String? = null,     val loginExpirationMinutes: UInt? = null,     val resetPasswordRedirectUrl: String? = null,     val resetPasswordExpirationMinutes: UInt? = null)

Data class used for wrapping parameters used with Passwords ResetByEmailStart endpoint

Link copied to clipboard
data class StrengthCheckParameters(val email: String?, val password: String)

Data class used for wrapping parameters used with Passwords StrengthCheck endpoint

Functions

Link copied to clipboard
abstract suspend fun authenticate(parameters: Passwords.AuthParameters): AuthResponse
abstract fun authenticate(parameters: Passwords.AuthParameters, callback: (AuthResponse) -> Unit)

Wraps the passwords authenticate API endpoint which validates the passwords token passed in. If this method succeeds, the user will be logged in, granted an active session

Link copied to clipboard
abstract suspend fun create(parameters: Passwords.CreateParameters): PasswordsCreateResponse
abstract fun create(parameters: Passwords.CreateParameters, callback: (PasswordsCreateResponse) -> Unit)

Wraps Stytch’s passwords create endpoint. Creates an account using an email and password given that an account with such an email does not already exist.

Link copied to clipboard
abstract suspend fun resetByEmail(parameters: Passwords.ResetByEmailParameters): AuthResponse
abstract fun resetByEmail(parameters: Passwords.ResetByEmailParameters, callback: (AuthResponse) -> Unit)

Wraps Stytch’s resetByEmail endpoint. Resets an account password by using a token and password.

Link copied to clipboard
abstract suspend fun resetByEmailStart(parameters: Passwords.ResetByEmailStartParameters): BaseResponse
abstract fun resetByEmailStart(parameters: Passwords.ResetByEmailStartParameters, callback: (BaseResponse) -> Unit)

Wraps Stytch’s resetByEmailStart endpoint. Initiates an account password reset by using an email.

Link copied to clipboard
abstract suspend fun strengthCheck(parameters: Passwords.StrengthCheckParameters): PasswordsStrengthCheckResponse
abstract fun strengthCheck(parameters: Passwords.StrengthCheckParameters, callback: (PasswordsStrengthCheckResponse) -> Unit)

Wraps Stytch’s strengthCheck endpoint. Advises on password strength when provided an email and a password.