B2B Saas Authentication

/

Mobile SDKs

/

React Native SDK reference

/

SSO

/

Start SSO Flow

Start SSO flow

The sso.start() method starts an SSO flow by redirecting the browser to Stytch's SSO Start endpoint. The method will also generate a PKCE code_verifier and store it in localstorage on the device.


Method parameters


connection_id*string

login_redirect_urlstring

signup_redirect_urlstring
import { Text, TouchableOpacity, View } from 'react-native';
import { useStytchB2BClient } from '@stytch/react-native/b2b';

export const Login = () => {
  const stytch = useStytchB2BClient();

  const startSSO = () =>
    stytch.sso.start({
      connection_id: 'saml-connection-test-51861cbc-d3b9-428b-9761-227f5fb12be9',
      login_redirect_url: 'https://example.com/authenticate',
      signup_redirect_url: 'https://example.com/authenticate',
    });

  return (
    <View>
      <TouchableOpacity onPress={startSSO}>
        <Text>Log in with Okta</Text>
      </TouchableOpacity>
    </View>
  );
};