> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Discover SSO Connections

> Discover SSO connections using the Stytch Next.js SDK

`sso.discoverConnections` 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.

### Response

<ResponseField name="connections" type="array">
  The list of SSO connections discovered for the provided email.

  <Expandable title="properties">
    <ResponseField name="connection_id" type="string">
      The ID of the SSO connection.
    </ResponseField>

    <ResponseField name="display_name" type="string">
      The display name of the SSO connection.
    </ResponseField>

    <ResponseField name="identity_provider" type="string">
      The identity provider of the SSO connection.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="request_id" type="string">
  Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
  may ask for this value to help identify a specific API call when helping you debug an issue.
</ResponseField>

<ResponseField name="status_code" type="number">
  The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
  equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
</ResponseField>

<Panel>
  <RequestExample>
    ```jsx theme={null}
    import { useState } from 'react';
    import { useStytchB2BClient } from '@stytch/nextjs/b2b';

    export const DiscoverSSO = () => {
      const stytch = useStytchB2BClient();
      const [connections, setConnections] = useState([]);

      const discoverConnections = async (email) => {
        const response = await stytch.sso.discoverConnections(email);
        setConnections(response.connections);
      };

      return (
        <div>
          <button onClick={() => discoverConnections('user@example.com')}>
            Discover Connections
          </button>
          {connections.map((conn) => (
            <div key={conn.connection_id}>
              {conn.display_name} - {conn.identity_provider}
            </div>
          ))}
        </div>
      );
    };
    ```
  </RequestExample>
</Panel>
