Interface SSO

  • All Implemented Interfaces:

    
    public 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

    • Constructor Detail

    • Method Detail

      • start

         abstract Unit start(SSO.StartParams params)

        Start an SSO authentication flow

        Parameters:
        params - required for beginning an SSO authentication flow
      • 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 call
        callback - 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 delete
        callback - a callback that receives a 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