All Projects → pelith → express-eauth

pelith / express-eauth

Licence: MIT license
ETH Authenticator package for Node

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to express-eauth

gas-reporting
Reference documentation on every gas price API and all the different formats
Stars: ✭ 85 (+165.63%)
Mutual labels:  metamask
vue-jazzicon
A dead-simple jazzicon component for VueJS
Stars: ✭ 41 (+28.13%)
Mutual labels:  metamask
ar-nft
👾 A React Native app to visualize your NFTs in AR
Stars: ✭ 71 (+121.88%)
Mutual labels:  metamask
Seedshift
Plausibly deniable steganographic encryption of BIP-39 mnemonic seed words with a date shift cipher
Stars: ✭ 21 (-34.37%)
Mutual labels:  metamask
use-metamask
a custom React Hook to manage Metamask in Ethereum ĐApp projects
Stars: ✭ 131 (+309.38%)
Mutual labels:  metamask
www-react-postgres
A complete template for 2022 focused on around React, Postgres and various web3 integrations. You can use the template to make a website, a web application, a hybrid decentralized web application, or even a DAO.
Stars: ✭ 36 (+12.5%)
Mutual labels:  metamask
opensea automatic uploader
(Bypass reCAPTCHAs) A Selenium Python bot to automatically and bulky upload and list your NFTs on OpenSea (all metadata integrated - Ethereum and Polygon supported); reCAPTCHA solver & bypasser included.
Stars: ✭ 205 (+540.63%)
Mutual labels:  metamask
node-metamask
🦊 Connect to MetaMask from node.js
Stars: ✭ 79 (+146.88%)
Mutual labels:  metamask
MetaMask.Blazor
Use MetaMask with Blazor WebAssembly
Stars: ✭ 26 (-18.75%)
Mutual labels:  metamask
filsnap
MetaMask snap for interacting with Filecoin dapps.
Stars: ✭ 60 (+87.5%)
Mutual labels:  metamask
eth-commerce
Javascript library to accept ethereum payments on any website
Stars: ✭ 24 (-25%)
Mutual labels:  metamask
ehr-blockchain
Electronic Health Record (EHR) and Electronic Medical Record (EMR) systems. However, they still face some issues regarding the security of medical records, user ownership of data, data integrity etc. The solution to these issues could be the use of a novel technology, i.e., Blockchain. This technology offers to provide a secure, temper-proof pl…
Stars: ✭ 41 (+28.13%)
Mutual labels:  metamask
openzeppelin-network.js
An easy to use and reliable library that provides one line access to Web3 API.
Stars: ✭ 45 (+40.63%)
Mutual labels:  metamask
tiddlywiki-ipfs
IPFS with TiddlyWiki
Stars: ✭ 50 (+56.25%)
Mutual labels:  metamask
starter-kit-gsn
An OpenZeppelin starter kit focused on GSN.
Stars: ✭ 39 (+21.88%)
Mutual labels:  metamask
sign-in-with-ethereum
Minimal example of sign in with Ethereum. Compatible with web3 browsers.
Stars: ✭ 25 (-21.87%)
Mutual labels:  metamask
NFT-Dapp-Boilerplate
A highly scalable NFT and DEFI boilerplate with pre added web3 and different wallets with a focus on performance and best practices
Stars: ✭ 51 (+59.38%)
Mutual labels:  metamask
connect-metamask-react-dapp
Build a simple React / Web3 Dapp that replicates a small portion of the Uniswap v2 interface
Stars: ✭ 204 (+537.5%)
Mutual labels:  metamask
svelte-box
A truffle box for svelte
Stars: ✭ 60 (+87.5%)
Mutual labels:  metamask
react-truffle-metamask
Build an DApp using react, redux, saga, truffle, metamask
Stars: ✭ 25 (-21.87%)
Mutual labels:  metamask

ETH Authenticator package for Node Express

This package works as a middleware for an Express app.

Exmaple

Refer this repository for an example setup, including a working demo server: https://github.com/pelith/node-eauth-server.

Setup

npm install express-eauth

Usage

Insert it as a middleware to authenticating routes in your Express app. After this middleware, the context object is stored as req.eauth, which has attributes listed inside callback functions.

const express = require('express');
const Eauth = require('express-eauth');

let eauthMiddleware = new Eauth({
  // all options and their default values
  signature: 'Signature',
  message: 'Message',
  address: 'Address',
  banner: 'Eauth',
});

const app = express();

/* --- Step 1: authentication request --- */
app.get('/auth/:Address', eauthMiddleware, (req, res) => { 
  //           ^^^^^^^^ the URL parameter

  /* req.eauth
   *   message: The challenge string.
   */
});

/* --- Step 2: challenge response --- */
app.get('/auth/:Message/:Signature', eauthMiddleware, (req, res) => { 
  /*
   * req.eauth
   *   recoveredAddress: The recovered wallet address for the signature.
   */
});

Workflow

  1. The client emits an authentication request.
  2. The server stores and responds with a challenge string.
  3. The client prompts and signs a message (challenge, banner) for a user, and send the challenge response to the server.
  4. The server looks up that challenge string, and matches the corresponding address against the one recovered from the signature. Respond the client with the result.
  5. The authentication is now done.

Options

  • signature='Signature'

  • message='Message'

  • address='Address'
    These options specify the corresponding URL parameter (in URL, not in query string!) for a request.

  • banner='Eauth':String
    An identifier for your app that is sent to the user when an authentication request is made. The user signs the challenge string along with the banner to prevent spoofings. It is strongly discouraged to use the default value.

Testing

npm install
npm test

Contact

For help on how to intergrate this package into your websites or apps, feel free to contact us at you -at- pelith -dot- com.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].