Skip to content

MultiversX App: Onboard Users

Estimated time to read: 5 minutes

Learn how to onboard users through the configured social login providers in a 'MultiversX' app.

Prerequisites

Non-EVM Chains

When registering an app through Arcana Developer Dashboard, the choice of chain type (EVM, Solana, MultiversX, Near) is final. App developers can't change it later. They can switch the default chain within the same type. For example, a Solana app on Testnet can switch to Solana Mainnet or Solana Dev but not to MultiversX or an EVM chain.

MultiversX Shard Selection

MultiversX uses adaptive state sharding for horizontal scaling. Shards allow it to process far more transactions through parallelization, improving transaction throughput and efficiency.

Choose your shard once when registering a MultiversX app on the Arcana Developer Dashboard. It cannot be changed later.

By default, Arcana uses 'Shard 0' to deploy all app contracts and allocate wallet addresses for users. The benefit is that when addresses from the same shard interact with contracts on the same shard, latencies are much lower than in cross-shard interactions.

Onboard Users

User Onboarding Considerations
  1. Log in Options: What options are offered by the app to the onboard users via social login? Configure the required social login providers via the dashboard.

  2. Built-in or Custom Login UI: Does the Web3 app have a custom login UI or do they need to use the built-in, plug-and-play login UI modal offered by the Arcana Auth SDK? Choose the appropriate onboarding functions of the AuthProvider.

  3. Session Management: Does the authenticated user stay logged in if they accidentally close the browser tab? If yes, what is the acceptable Web3 app security window for the session? After how long should the session expire and a user re-login is necessitated for security? Configure the session management settings via the dashboard.

  4. Reconnect: Does the Web3 app allow users to stay connected or require re-authentication after a certain time has elapsed? Use isConnected, canReconnect and reconnect functions of the AuthProvider.

Advanced

Arcana JWT Token

Upon successful authentication, Arcana Auth SDK returns a unique JWT token to the app called the Arcana JWT Token. App developers can access this token via getUser() method and refer to the loginToken field of the UserInfo object.

Developers can use this token to verify the user and subsequently generate another token for app use if required.

In the future, the Arcana JWT Token will be deprecated. Use userDIDToken to verify user.

Upon successful authentication, Arcana Auth SDK returns a unique DID token to the app called the Arcana DID Token. App developers can access this token via getUser() method and refer to the userDIDToken field of the UserInfo object.

Developers can use this token to verify the user and subsequently generate another token for app use.

Global vs. App Specific Keys

Apps using app-specific keys must use a custom login UI that allows users to input the OTP. In this case, the isCompleteRequired boolean returns true after initiating login with OTP.

Apps using global keys are not required to use a custom login UI. A built-in login UI is automatically displayed for the user for OTP. Users must enter the OTP received via email in this UI.

MFA Enabled / Disabled

During passwordless login via OTP, apps configured for MFA and those using overlays must hide it to enable OTP input. Use the isMFARequired callback in the loginWithOTPComplete method to hide the overlay.

Reconnect Users

Use canReconnect and reconnect methods of AuthProvider within a 30-min window of the user-logout action. Allow users to automatically reconnect to the app without re-authentication.

See canReconnect and reconnect for details.

Apps Using Custom Auth

Web3 apps that use custom user authentication solutions and require authenticated users to sign blockchain transactions can also integrate with the Arcana Auth SDK. These apps can skip the social onboarding feature and use loginWithCustomProvider function of the AuthProvider to assign keys securely. Learn more...

What's Next?

Use the EIP-1193 provider offered by the SDK to call JSON/RPC functions and other supported Web3 wallet operations on MultiversX in the authenticated user's context.

See Also

'MultiversX' integration example: See sample-auth-mvx submodule in Auth Examples

Try Demo App!


Last update: July 31, 2024 by shaloo