AuthenticateWith
These are all methods on the SignIn
class that allow you to authenticate with different methods.
Methods
authenticateWithRedirect()
Signs in users via OAuth. This is commonly known as Single Sign On (SSO), where an external account is used for verifying the user's identity.
- Name
strategy
- Type
OAuthStrategy | 'saml' | 'enterprise_sso'
- Description
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>
.'saml'
(deprecated): Deprecated in favor of'enterprise_sso'
. The user will be authenticated with their SAML account.'enterprise_sso'
: The user will be authenticated either through SAML or OIDC depending on the configuration of their enterprise SSO account.
- Name
redirectUrl
- Type
string
- Description
The full URL or path that the OAuth provider should redirect to, on successful authorization on their part. Typically, this will be a simple
/sso-callback
route that callsClerk.handleRedirectCallback
or mounts the<AuthenticateWithRedirectCallback />
component. See the custom flow for implementation details.
- Name
redirectUrlComplete
- Type
string
- Description
The full URL or path that the user will be redirected to once the sign-in is complete.
- Name
identifier
- Type
string | undefined
- Description
- Name
emailAddress
- Type
string | undefined
- Description
The email address used to target an enterprise connection during sign-in.
- Name
legalAccepted
- Type
boolean | undefined
- Description
A boolean indicating whether the user has agreed to the legal compliance documents.
authenticateWithMetamask()
Starts a sign-in flow that uses the Metamask browser extension to authenticate the user using their Web3 wallet address. Returns a SignIn
object.
authenticateWithCoinbaseWallet()
Starts a sign-in flow that uses the Coinbase Wallet to authenticate the user using their Web3 wallet address. Returns a SignIn
object.
authenticateWithOKXWallet()
Starts a sign-in flow that uses the OKX Wallet to authenticate the user using their Web3 wallet address. Returns a SignIn
object.
authenticateWithWeb3()
Starts a sign-in flow that authenticates the user against their Web3 wallet address. Returns a SignIn
object.
- Name
identifier
- Type
string
- Description
The user's Web3 ID.
- Name
generateSignature
- Type
(opts: GenerateSignatureParams) => Promise<string>
- Description
The method of how to generate the signature for the Web3 sign-in. See
GenerateSignatureParams
for more information.
- Name
strategy?
- Type
Web3Strategy
- Description
The Web3 verification strategy.
GenerateSignatureParams
- Name
identifier
- Type
string
- Description
The user's Web3 wallet address.
- Name
nonce
- Type
string
- Description
The cryptographic nonce used in the sign-in.
- Name
provider?
- Type
Web3Provider
- Description
authenticateWithPasskey()
Starts a sign-in flow that allows a user to choose a passkey to sign into their account with. Returns a SignIn
object.
AuthenticateWithPasskeyParams
- Name
flow
- Type
string | undefined
- Description
Can be
autofill
ordiscoverable
'autofill'
enables the client to prompt your users to select a passkey before they interact with your app.'discoverable'
requires the user to interact with the client.- To call
authenticateWithPasskey()
with no params, you must first callSignIn.create({ strategy: 'passkey' })
. This is useful if you don't know which sign-in strategy will be used. See the docs forSignIn.create()
for more information.
Feedback
Last updated on