project screenshot 1

Sign In with Ethereum plugin for Fastify

A plugin that allows painless setup of Sign in with Ethereum on Fastify

Sign In with Ethereum plugin for Fastify

Created At

ETHAmsterdam

Winner of

trophy

📚 Spruce — SiwE Contribution

Project Description

This is a Fastify plugin that utilises Sign in with Ethereum by allowing to generate new nonce and handles authentication using signatures generated by Metamask. 1. The frontend requests a nonce from the backend server. The nonce must be generated and verified on the backend to protect against replay attacks.

  1. The dapp signs the message with user's wallet and saves the signed message locally.

  2. An Authentication header is included in every request with the signed message. See more in Readme

How it's Made

This project is a typescript library published to NPM. It can be reused to add authentication using Sign in with Ethereum to Fastify backends. The library includes a plugin that adds a middleware that authenticates every request containing "Authentication" header. The header must contain the signed message in the SIWE format. Every authenticated request will contain a session object that exposes the autheticated user's address for authorization.

background image mobile

Join the mailing list

Get the latest news and updates