useSignInWithSAML
useSignInWithSAML():
UseMutationResult<DataResponse<{provider:string;url:string; }>,Error, {options?:SAMLLoginOptions;provider:string; },unknown>
Hook to initiate SAML login (redirects to IdP)
This hook returns a mutation that when called, redirects the user to the SAML Identity Provider for authentication.
Returns
Section titled “Returns”UseMutationResult<DataResponse<{ provider: string; url: string; }>, Error, { options?: SAMLLoginOptions; provider: string; }, unknown>
Example
Section titled “Example”function SAMLLoginButton() { const signInWithSAML = useSignInWithSAML()
return ( <button onClick={() => signInWithSAML.mutate({ provider: 'okta' })} disabled={signInWithSAML.isPending} > {signInWithSAML.isPending ? 'Redirecting...' : 'Sign in with Okta'} </button> )}