Laravel Authentication using Web3

Hafiq Iqmal
Geek Culture
Published in
7 min readNov 23, 2021

--

Source: www.notboring.co

Traditional username or email and password are highly unpopular among online users nowadays because you need to remember your credentials. Now, users are more prefer to use one-click social media logins through Facebook, Google, Twitter and etc. If you are application user, you will see “Login with Facebook”, “Login with Google” almost everywhere.

During the hype of NFT nowadays, i find out there is another one-click login method using blockchain technology called Web3.js and Metamask. MetaMask is a browser plugin which serves as an Ethereum wallet and allow to interact decentralized apps (dApps). For long short story specifically, with the technology of Web3.js, we can authenticate to Metamask account and serve as your online identity.

Hence, for this article, i will show your how to create one-click authentication using Web3.js and Metamask in Laravel. Please note that while we will be using Metamask Ethereum blockchain.

Lets get started

The flow principles are the same as any another social media authentication:-

  • Click “Login with Metamask”
  • Fetch nonce from backend server and…

--

--

Hafiq Iqmal
Geek Culture

Technical Lead | Software Engineer | Laravel Enthusiasts | Tech writer | UiTM Alumni | Husband | Proud father of a beautiful daughter