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 @JvmOverloads constructor(val ssoToken: String, val sessionDurationMinutes: Int = DEFAULT_SESSION_TIME_MINUTES, val locale: Locale? = null)

Data class used for wrapping parameters used in SSO Authenticate calls

Link copied to clipboard
interface OIDC

The OIDC interface provides methods for creating and updating an OIDC connection

Link copied to clipboard
interface SAML

The SAML interface provides methods for creating, updating, and deleting a SAML connection

Link copied to clipboard
data class StartParams @JvmOverloads constructor(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

Exposes an instance of the OIDC interface

Link copied to clipboard
abstract val saml: SSO.SAML

Exposes an instance of the SAML interface

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

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

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

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