āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/clerk/clerk-docs/reference/expo/use-sso ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
The useSSO() hook is used to create a new SSO flow. It can be used in both web and native apps.
The useSSO() hook returns the startSSOFlow() method, which you can use to initiate the SSO flow.
startSSOFlow()startSSOFlow() has the following function signature:
function startSSOFlow(startSSOFlowParams: StartSSOFlowParams): Promise<StartSSOFlowReturnType>
startSSOFlow() accepts the following parameters (StartSSOFlowParams):
The strategy to use for authentication. The following strategies are supported:
'oauth_<provider>': The user will be authenticated with their social connection account. See a list of supported values for <provider>.'enterprise_sso': The user will be authenticated either through SAML, EASIE, or OIDC depending on the configuration of their enterprise SSO account.identifier?Required if strategy is set to 'enterprise_sso'. The identifier of the user.
redirectUrl?stringThe full URL or path to redirect to after the SSO flow is complete. If not specified, defaults to sso-callback path.
unsafeMetadata?SignUpUnsafeMetadataMetadata that can be read and set from the frontend and the backend. Once the authentication process is complete, the value of this field will be automatically copied to the created user's unsafe metadata (User.unsafeMetadata). One common use case is to collect custom information about the user during the authentication process and store it in this property. Read more about unsafe metadata.
</Properties>
startSSOFlow() returns the following:
The ID of the session that was created.
authSessionResult?WebBrowser.WebBrowserAuthSessionResult | undefinedThe result of the web browser session. See the Expo WebBrowser documentation for more details.
setActive?(params: SetActiveParams) => Promise<void>A method used to set the active session and/or organization. Accepts a SetActiveParams object.
signIn?The SignIn object that was created, which holds the state of the current sign-in and provides helper methods to navigate and complete the sign-in process.
signUp?The SignUp object that was created, which holds the state of the current sign-up and provides helper methods to navigate and complete the sign-up process.
</Properties>
useSSO() hookFor detailed examples of how to use the useSSO() hook, see the following guides:
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā