SSO

interface SSO

Single-Sign On (SSO) refers to the ability for a user to use a single identity to authenticate and gain access to multiple apps and service. In the case of B2B, it generally refers for the ability to use a workplace identity managed by their company. Read our blog post for more information about SSO.

Stytch supports the following SSO protocols:

  • SAML

Types

Link copied to clipboard
data class AuthenticateParams(val ssoToken: String, val sessionDurationMinutes: UInt = Constants.DEFAULT_SESSION_TIME_MINUTES)

Data class used for wrapping parameters used in SSO Authenticate calls

Link copied to clipboard
interface OIDC
Link copied to clipboard
interface SAML
Link copied to clipboard
data class StartParams(val context: Activity, val ssoAuthRequestIdentifier: Int, val connectionId: String, val loginRedirectUrl: String? = null, val signupRedirectUrl: String? = null)

Data class used for wrapping parameters used in SSO start calls

Properties

Link copied to clipboard
abstract val oidc: SSO.OIDC
Link copied to clipboard
abstract val saml: SSO.SAML

Functions

Link copied to clipboard
abstract fun authenticate(params: SSO.AuthenticateParams, callback: (SSOAuthenticateResponse) -> Unit)

Authenticate a user given a token. This endpoint verifies that the user completed the SSO Authentication flow by verifying that the token is valid and hasn't expired.

Link copied to clipboard
abstract suspend fun deleteConnection(connectionId: String): B2BSSODeleteConnectionResponse
abstract fun deleteConnection(connectionId: String, callback: (B2BSSODeleteConnectionResponse) -> Unit)

Delete an existing SSO connection.

Link copied to clipboard
abstract fun getConnections(callback: (B2BSSOGetConnectionsResponse) -> Unit)

Get all SSO Connections owned by the organization. This method wraps the {@link https://stytch.com/docs/b2b/api/get-sso-connections Get SSO Connections} API endpoint. The caller must have permission to call this endpoint via the project's RBAC policy & their role assignments.

Link copied to clipboard
abstract fun start(params: SSO.StartParams)

Start an SSO authentication flow