Skip to content

User Login with Twitter

In this guide, you will learn how a 'Vanilla HTML/CSS/JS' app integrated with the Arcana Auth SDK can easily onboard users via custom login UI and Twitter as the authentication provider.

Prerequisites

Steps

Using Twitter to onboard users in a Web3 app that is integrated with the Arcana Auth SDK is simple!

Just a single line of code!

Step 1: Call loginWithSocial function

Make sure that all the prerequisites listed above are met. The app should be successfully registered, configured, and integrated with the Arcana Auth SDK, before adding code to onboard users via Twitter.

await auth.loginWithSocial('twitter')

Check if a user is logged in:

const connected = await auth.isLoggedIn()

Add code in the application to log out an authenticated user:

await auth.logout()

That is all!

The Web3 app is all set for onboarding users via Twitter.

No Aggregate Login with Twitter OAuth

The aggregate login feature does not work for the Steam OAuth login mechanism.

When a user has the same email registered with a social login provider and Steam OAuth, logging in with Steam makes a new unique account. Even if the user later logs in with the same email through a social login provider or passwordless, it creates a different wallet address for the same user.

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 use this token to verify user login and subsequently generate another token for app use. Learn more about how to verify the Arcana JWT Token for apps deployed on Testnet and Mainnet.

What's Next?

After onboarding app users via Twitter, you can allow authenticated users to access the Arcana wallet for signing blockchain transactions on any supported blockchain network. Plug in other Arcana Auth SDK functions in the app code such as getting the authenticated user's account details, performing Web3 wallet operations, etc. See Arcana Auth SDK Usage Guide and Arcana wallet Developer's Guide for details.

See also


Last update: April 7, 2024 by shaloo, shaloo