Docs

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.

function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promise<void>
  • Name
    strategy
    Type
    OAuthStrategy | 'saml'
    Description

    The strategy corresponding to the OAuth provider. For example: oauth_facebook, oauth_github, etc.

  • Name
    redirectUrl
    Type
    string
    Description

    Full URL or path to the route that will complete the OAuth or SAML flow. Typically, this will be a simple /sso-callback route that calls Clerk.handleRedirectCallback or mounts the <AuthenticateWithRedirectCallback /> component.

  • Name
    redirectUrlComplete
    Type
    string
    Description

    The URL that the user will be redirected to, after successful authorization from the OAuth provider and Clerk sign in.

authenticateWithMetamask()

Starts a sign-in flow that uses the Metamask browser extension to authenticate the user using their Web3 wallet address.

function authenticateWithMetamask(): Promise<SignInResource>

Returns

TypeDescription
Promise<SignInResource>A Promise which resolves to the current SignIn.

authenticateWithCoinbaseWallet()

Starts a sign-in flow that uses the Coinbase Wallet to authenticate the user using their Web3 wallet address.

function authenticateWithCoinbaseWallet(): Promise<SignInResource>

Returns

TypeDescription
Promise<SignInResource>A Promise which resolves to the current SignIn.

authenticateWithWeb3()

Starts a sign-in flow that authenticates the user against their Web3 wallet address.

function authenticateWithWeb3(params: AuthenticateWithWeb3Params): Promise<SignInResource>
  • 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 details.

  • 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

Returns

TypeDescription
Promise<SignInResource>A Promise which resolves to the current SignIn.

authenticateWithPasskey()

Starts a sign-in flow that allows a user to choose a passkey to sign into their account with.

function authenticateWithPasskey(params?: AuthenticateWithPasskeyParams): Promise<SignInResource>

Learn more:

AuthenticateWithPasskeyParams
  • Name
    flow
    Type
    string | undefined
    Description

    Can be autofill or discoverable

  • '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 call SignIn.create({ strategy: 'passkey' }). This is useful if you don't know which sign-in strategy will be used. See the docs for SignIn.create() for more information.

Feedback

What did you think of this content?

Last updated on