Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

AuthenticateWith

These are all methods on the SignIn class that allow you to authenticate with different methods.

Methods

authenticateWithRedirect()

function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promise<void>;

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.

AuthenticateWithRedirectParams

NameTypeDescription
strategyOAuthStrategy | 'saml'The strategy corresponding to the OAuth provider. For example: oauth_facebook, oauth_github, etc.
redirectUrlstringThe URL that the OAuth provider should redirect to, on successful authorization on their part.
redirectUrlCompletestringThe URL that the user will be redirected to, after successful authorization from the OAuth provider and Clerk sign in.

Returns

TypeDescription
Promise<void>This method returns a Promise which doesn't resolve to any value.

authenticateWithMetamask()

function authenticateWithMetamask(): Promise<SignInResource>;

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

Returns

TypeDescription
Promise<SignInResource>This method returns a Promise which resolves to the current SignIn.

authenticateWithWeb3()

function authenticateWithWeb3(params: AuthenticateWithWeb3Params): Promise<SignInResource>;

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

AuthenticateWithWeb3Params

NameTypeDescription
identifierstringThe user's Web3 ID.
generateSignature(opts: GenerateSignatureParams) => Promise<string>The method of how to generate the signature for the Web3 sign-in. See GenerateSignatureParams for more details.
GenerateSignatureParams
NameTypeDescription
identifierstringThe user's Web3 ID.
noncestringThe cryptographic nonce(opens in a new tab) used in the sign-in.

Last updated on March 19, 2024

What did you think of this content?

Clerk © 2024