Build Passwordless Auth
In this guide, you will learn how to enable passwordless authentication and onboard dApp users.
Prerequisites
- Make sure you can access Arcana Developer Dashboard: https://dashboard.arcana.network
- Install the
@arcana/auth
package. For details, see Arcana Auth Quick Start Guide.
Steps
To set up passwordless authentication, you simply need to register your dApp using the Arcana Developer dashboard and then integrate and use the Arcana Auth SDK. No additional setup or configuration is required.
Step 1: Register and Configure dApp
Go to the Arcana Dashboard: https://dashboard.arcana.network
If this is your first visit to the dashboard, create a new entry for your dApp to register it. Once the dApp is registered using the dashboard, Arcana Network assigns an Client ID for every dApp.
Info
You need to save this Client ID.
After completing the dApp configuration at the dashboard, you will be required to specify this Client ID while integrating your dApp code with the Arcana Auth SDK.
You can revisit the Arcana Dashboard later and reference the Client ID displayed on the top right of the dashboard.
Optionally, you can use defaults for other dApp settings or choose to modify them as per your dApp use case. See how to configure your dApp guide for details.
Note
You can enable more than one social provider to authenticate dApp users. In addition to passwordless login, you can also allow the users to onboard using other social providers.
Step 2: Integrate with Arcana Auth SDK
Use instructions here to integrate with Arcana Auth SDK
Trigger passwordless to onboard users. Specify the email ID provided by the dApp user as the input.
await wallet.loginWithLink(`${email}`)
Check if the user has logged in successfully:
const connected = await auth.isLoggedIn()
Use other Auth SDK functions in your dApp. See Auth SDK Usage Guide for details.
Log out the dApp user when requested:
await auth.logout()
That is all!
Your dApp is all set for onboarding users via the passwordless login mechanism.
What's Next?
After enabling passwordless login in your dApp, you can allow authenticated users to access the Arcana wallet for signing blockchain transactions on any EVM-compatible network.
See also
- Arcana authentication concepts.
- Configure Social Providers
- Troubleshooting authentication errors
- Auth SDK Usage Guide
- Auth SDK Reference Guide