External Wallet Login
Learn how to connect the external wallets to authenticate users.
Connect wallet via the Sign in With Ethereum (SIWE) standard. Catered to users who prefer to authenticate using their external wallets, supporting various types such as injected, browser-based, and mobile wallets. Openfort’s integration facilitates a secure and direct authentication process using these wallets.
First create a challenge for the user to sign with their wallet by constructing a SIWE challenge using the nonce returned from the server:
Then, verify the SIWE signature to authenticate the user:
walletClientType
: e.g. coinbaseWallet, metamask, etc.connectorType
: wallet_connect_v2, injected, coinbase_wallet, etc.
_11import openfort from "./openfortConfig"_11const address = 'EXTERNAL_WALLET_ADDRESS';_11_11async function authSIWE(signature, message, walletClientType, connectorType) {_11 await openfort.authenticateWithSIWE({_11 signature: signature,_11 message: SIWEMessage,_11 connectorType: connector?.type,_11 walletClientType: connector?.name,_11 });_11}
And you’re done! The user is now authenticated and can access your application.
Uppon successful authentication, the SDK will return a token that can be used to authenticate the user in your application.