Interface SSO
-
- All Implemented Interfaces:
public interface SSOSingle-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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSSO.StartParamsData class used for wrapping parameters used in SSO start calls
public final classSSO.GetTokenForProviderParamsData class used for wrapping parameters to start a third party OAuth flow and retrieve a token
public final classSSO.AuthenticateParamsData class used for wrapping parameters used in SSO Authenticate calls
public interfaceSSO.SAMLThe SAML interface provides methods for creating, updating, and deleting a SAML connection
public interfaceSSO.OIDCThe OIDC interface provides methods for creating and updating an OIDC connection
-
Method Summary
Modifier and Type Method Description abstract UnitsetSSOReceiverActivity(ComponentActivity activity)abstract Unitstart(SSO.StartParams params)Start an SSO authentication flow abstract StytchResult<String>getTokenForProvider(SSO.GetTokenForProviderParams parameters)abstract UnitgetTokenForProvider(SSO.GetTokenForProviderParams parameters, Function1<StytchResult<String>, Unit> callback)abstract CompletableFuture<StytchResult<String>>getTokenForProviderCompletable(SSO.GetTokenForProviderParams parameters)abstract StytchResult<SSOAuthenticateResponseData>authenticate(SSO.AuthenticateParams params)Authenticate a user given a token. abstract Unitauthenticate(SSO.AuthenticateParams params, Function1<StytchResult<SSOAuthenticateResponseData>, Unit> callback)Authenticate a user given a token. abstract CompletableFuture<StytchResult<SSOAuthenticateResponseData>>authenticateCompletable(SSO.AuthenticateParams params)Authenticate a user given a token. abstract StytchResult<B2BSSOGetConnectionsResponseData>getConnections()Get all SSO Connections owned by the organization. abstract UnitgetConnections(Function1<StytchResult<B2BSSOGetConnectionsResponseData>, Unit> callback)Get all SSO Connections owned by the organization. abstract CompletableFuture<StytchResult<B2BSSOGetConnectionsResponseData>>getConnectionsCompletable()Get all SSO Connections owned by the organization. abstract StytchResult<B2BSSODeleteConnectionResponseData>deleteConnection(String connectionId)Delete an existing SSO connection. abstract UnitdeleteConnection(String connectionId, Function1<StytchResult<B2BSSODeleteConnectionResponseData>, Unit> callback)Delete an existing SSO connection. abstract CompletableFuture<StytchResult<B2BSSODeleteConnectionResponseData>>deleteConnectionCompletable(String connectionId)Delete an existing SSO connection. abstract StytchResult<B2BSSODiscoveryConnectionResponseData>discoverConnections(String emailAddress)The SSO Discovery method surfaces SSO connections for the end user. abstract UnitdiscoverConnections(String emailAddress, Function1<StytchResult<B2BSSODiscoveryConnectionResponseData>, Unit> callback)The SSO Discovery method surfaces SSO connections for the end user. abstract CompletableFuture<StytchResult<B2BSSODiscoveryConnectionResponseData>>discoverConnectionsCompletable(String emailAddress)The SSO Discovery method surfaces SSO connections for the end user. abstract SSO.SAMLgetSaml()Exposes an instance of the SAML interface abstract SSO.OIDCgetOidc()Exposes an instance of the OIDC interface -
-
Method Detail
-
setSSOReceiverActivity
abstract Unit setSSOReceiverActivity(ComponentActivity activity)
-
start
abstract Unit start(SSO.StartParams params)
Start an SSO authentication flow
- Parameters:
params- required for beginning an SSO authentication flow
-
getTokenForProvider
abstract StytchResult<String> getTokenForProvider(SSO.GetTokenForProviderParams parameters)
-
getTokenForProvider
abstract Unit getTokenForProvider(SSO.GetTokenForProviderParams parameters, Function1<StytchResult<String>, Unit> callback)
-
getTokenForProviderCompletable
abstract CompletableFuture<StytchResult<String>> getTokenForProviderCompletable(SSO.GetTokenForProviderParams parameters)
-
authenticate
abstract StytchResult<SSOAuthenticateResponseData> authenticate(SSO.AuthenticateParams params)
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.
- Parameters:
params- required for making an authenticate call- Returns:
SSOAuthenticateResponse
-
authenticate
abstract Unit authenticate(SSO.AuthenticateParams params, Function1<StytchResult<SSOAuthenticateResponseData>, Unit> callback)
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.
- Parameters:
params- required for making an authenticate callcallback- a callback that receives a SSOAuthenticateResponse
-
authenticateCompletable
abstract CompletableFuture<StytchResult<SSOAuthenticateResponseData>> authenticateCompletable(SSO.AuthenticateParams params)
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.
- Parameters:
params- required for making an authenticate call- Returns:
SSOAuthenticateResponse
-
getConnections
abstract StytchResult<B2BSSOGetConnectionsResponseData> getConnections()
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.
- Returns:
B2BSSOGetConnectionsResponse
-
getConnections
abstract Unit getConnections(Function1<StytchResult<B2BSSOGetConnectionsResponseData>, Unit> callback)
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.
- Parameters:
callback- a callback that receives a B2BSSOGetConnectionsResponse
-
getConnectionsCompletable
abstract CompletableFuture<StytchResult<B2BSSOGetConnectionsResponseData>> getConnectionsCompletable()
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.
- Returns:
B2BSSOGetConnectionsResponse
-
deleteConnection
abstract StytchResult<B2BSSODeleteConnectionResponseData> deleteConnection(String connectionId)
Delete an existing SSO connection.
- Parameters:
connectionId- The ID of the connection to delete- Returns:
B2BSSODeleteConnectionResponse
-
deleteConnection
abstract Unit deleteConnection(String connectionId, Function1<StytchResult<B2BSSODeleteConnectionResponseData>, Unit> callback)
Delete an existing SSO connection.
- Parameters:
connectionId- The ID of the connection to deletecallback- a callback that receives a B2BSSODeleteConnectionResponse
-
deleteConnectionCompletable
abstract CompletableFuture<StytchResult<B2BSSODeleteConnectionResponseData>> deleteConnectionCompletable(String connectionId)
Delete an existing SSO connection.
- Parameters:
connectionId- The ID of the connection to delete- Returns:
B2BSSODeleteConnectionResponse
-
discoverConnections
abstract StytchResult<B2BSSODiscoveryConnectionResponseData> discoverConnections(String emailAddress)
The SSO Discovery method surfaces SSO connections for the end user. It will return all active SSO connections for an end user or, if no active connections are found, it will return all SSO connections that the end user could JIT provision into based on the provided email address.
- Parameters:
emailAddress- Email address to return SSO connection IDs for.- Returns:
B2BSSODiscoveryConnectionResponse
-
discoverConnections
abstract Unit discoverConnections(String emailAddress, Function1<StytchResult<B2BSSODiscoveryConnectionResponseData>, Unit> callback)
The SSO Discovery method surfaces SSO connections for the end user. It will return all active SSO connections for an end user or, if no active connections are found, it will return all SSO connections that the end user could JIT provision into based on the provided email address.
- Parameters:
emailAddress- Email address to return SSO connection IDs for.callback- A callback that receives a B2BSSODiscoveryConnectionResponse
-
discoverConnectionsCompletable
abstract CompletableFuture<StytchResult<B2BSSODiscoveryConnectionResponseData>> discoverConnectionsCompletable(String emailAddress)
The SSO Discovery method surfaces SSO connections for the end user. It will return all active SSO connections for an end user or, if no active connections are found, it will return all SSO connections that the end user could JIT provision into based on the provided email address.
- Parameters:
emailAddress- Email address to return SSO connection IDs for.- Returns:
B2BSSODiscoveryConnectionResponse
-
-
-
-