The Sign-In Flow
1
User Initiates Authentication
The user clicks your sign-in button and your application calls The call is identical for sign-up and sign-in. SocketFi handles the routing automatically based on whether a registered credential exists for the current device.
socketfi.authenticate(). The SDK detects an existing account associated with the device and begins the sign-in flow rather than the registration flow.2
Passkey Challenge Issued
SocketFi generates a unique one-time challenge and passes it to the browser’s WebAuthn API. The platform prompts the user with their registered authenticator.No challenge is ever reused. If an attacker intercepts a signed response from a previous session, it cannot be replayed against a new challenge.
3
Signature Verified
The user confirms their identity through biometrics or PIN. The authenticator signs the challenge with the private key stored in secure hardware and returns the signature.SocketFi verifies three things:
- The challenge matches the one issued for this request
- The signature is valid against the registered public key
- The credential ID belongs to an active, registered account
4
Wallet Resolved
Once identity is confirmed, SocketFi maps the verified credential to the user’s wallet address. No new wallet is created or deployed.The wallet address, balances, transaction history, and all associated state remain exactly as the user left them.
5
Session Returned
SocketFi creates a new session and returns it to your application. The user is authenticated and their wallet is accessible.Note that
socketfiAccessToken is a new signed token even though the wallet address is unchanged. Previous tokens from earlier sessions are not refreshed — you always need the latest token from a successful authenticate() call.The Session Response
Sign-in returns the sameSession structure as sign-up:
Multi-Device Authentication
Users who have set up passkeys on multiple devices can authenticate from any of them. Each device holds its own copy of the passkey private key — authentication on one device does not affect the ability to authenticate from another.The number of simultaneously registered credentials per user depends on your SocketFi application configuration. Review your platform settings if you need to adjust credential limits.
Session Expiration and Re-Authentication
Sessions are time-limited. Once asocketfiAccessToken expires, your backend will reject requests that include it. Design your application to handle this gracefully:
Failure Scenarios
Handle these cases to provide a smooth experience for your users.What Doesn’t Change During Sign-In
Sign-in is explicitly non-destructive. Nothing about the user’s wallet or account changes:
The session token is the only thing that changes. Everything else persists from the last time the user was active.