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.
Start SSO flow
Method parameters
connection_id* string
login_redirect_url string
signup_redirect_url string
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>
);
};