Passwordless
In this guide you will learn how to enable Web3 user onboarding in your dApp via passwordless authentication.
Prerequisites
- Make sure you can access Arcana Developer Dashboard:
- Install the
@arcana/auth
package. For details, see Arcana Auth Quick Start Guide.
Basic Steps
At a high level, you need to perform these two steps for enabling passwordless authentication in your dApp:
Step 1: Choose Login Type: Passwordless
Go to the Arcana Dashboard:
If this is your first visit to the dashboard, create a new entry for your dApp to register it.
Once the dApp is registerd using the dashboard, Arcana Network assigns an appID for every dApp.
info
You need to save this App ID.
After completing the dApp configuration at the dashboard, you will be required to specify this appID while integrating your dApp code with the Arcana Auth SDK.
Click on the
Auth
tab. Refer to thePasswordless Auth
section. Specify the JavaScript Origin and Redirect URI for your dApp.note
You can enable more than one authentication mechanism for dApp end users. In addition to passwordless login, you can also allow dApp users to onboard using other supported authentication mechanisms.
JavaScript Origin - Specify the HTTP origin that hosts your dApp application along with the port number (if not 80). Wildcards, paths are not allowed. Example: https://example.com:8080
Redirect URI - Specify the URL where users of this dApp will be redirected to, once a user clicks on the verification link received from Arcana via email. URL fragments, relative paths, wildcards, and public IP addresses are not supported.
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.
tip
You can revisit Arcana Dashboard later and reference the appID displayed on the top right of the dashboard. You can also view and modify configuration settings for your dApp later.
caution
Not all configuration settings can be changed once selected.
For example, once you choose the
region
where dApp user data is stored in Arcana Store, you cannot change it later.Also, if you enable the
Wallet UI
display mode, you cannot turn it off due to security considerations.
Step 2: Integrate with Arcana Auth SDK
Use instructions here to integrate with Arcana Auth SDK
Next, trigger passwordless login by calling
loginWithLink
function. Specify the email ID provided by the dApp user as the input:await wallet.loginWithLink(`${email}`)
Check if the user has logged in successfully:
//Check is logged in
const loggedIn = await wallet.isLoggedIn()
//Use other Auth SDK functions or integrate with Storage SDKLog out the dApp user when requested:
await wallet.logout()
That is all! 🎉
Your dApp is all set for onboarding users via passwordless login mechanism.
What's Next?
After enabling passwordless login in your dApp, you can also use the Auth SDK for encrypting or decrypting data user data.
You can further integrate with Arcana Storage SDK if your application needs to store, retrieve or share file data. All file store and access operations require file owners to sign blockchain transactions using the ethereum provider exposed by Arcana Auth SDK.