msyvr / semm

Demo: Flask app to authenticate user via decentralized ID

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo: Flask app with Sign In With Ethereum for MetaMask users

Flask + JavaScript + Python + MetaMask API + SIWE

This demo Flask app enables authentication of MetaMask users via Sign In With Ethereum per EIP 4361.

A Python backend mediates the SIWE authentication. A JavaScript/HTML front end mediates communication with users via their MetaMask accounts.

MetaMask injects an API into websites visited by logged-in MetaMask users; this API is leveraged to request a user signature on an EIP 4361 conforming message. The message and signature are then verified by SIWE to enable user login to the demo app: the user's decentralized identity is authenticated, eliminating the need for traditional username/password authentication.

Use

  • see deploy.sh

Status

  • login landing page
  • retrieve user eth address
  • build EIP-4316 conforming message for user signature
  • generate MetaMask personal sign request
  • instantiate SiweMessage with arg = message (from MetaMask sig request)
  • redirect for unverified credentials (no 'login')
  • info page (basics of how siwe works)

Currently disabled

  • final validation by siwe: tentative protocol (in process), a value error is currently raised during the decentralized identity authentication process

About

Demo: Flask app to authenticate user via decentralized ID


Languages

Language:Python 97.7%Language:C 1.3%Language:Cython 0.6%Language:Solidity 0.3%Language:JavaScript 0.0%Language:PowerShell 0.0%Language:CSS 0.0%Language:HTML 0.0%Language:C++ 0.0%Language:Shell 0.0%Language:Assembly 0.0%Language:Jinja 0.0%Language:Batchfile 0.0%