GithubHelp home page GithubHelp logo

vmandal / email-vc-issuer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rsksmart/email-vc-issuer

0.0 1.0 0.0 2.16 MB

Email VC Issuer

License: MIT License

HTML 5.25% JavaScript 0.13% TypeScript 93.02% CSS 0.98% Dockerfile 0.33% Shell 0.28%

email-vc-issuer's Introduction

logo

email-vc-issuer

Email Verifiable Credential issuer.

alerts

This service allows the controller of a decentralized identity to verify your email address.

Try it

Configure

Create an .env file under ./back folder with the following:

PRIVATE_KEY=private key associated to the service. Is used to sign the email VCs

Optionally you can set:

SMTP_HOST=host of the mail server
SMTP_PORT=port of the mail server
SMTP_USER=user to log in to the mail server. Will be used to set the from of the email
SMTP_PASS=password to log in to the mail server
LOG_FILE=relative path of the log file
LOG_ERROR_FILE=relative path of the error log file
NETWORK_NAME=rsk:testnet or rsk
PORT=port where the service will be served

To run in production you will have to set SMTP variables. Ethereal is a testing framework.

Default values:

SMTP_HOST=dynamically created using https://ethereal.email/
SMTP_PORT=dynamically created using https://ethereal.email/
SMTP_USER=dynamically created using https://ethereal.email/
SMTP_PASS=dynamically created using https://ethereal.email/
LOG_FILE=./log/email-vc-issuer.log
LOG_ERROR_FILE=./log/email-vc-issuer.error.log
NETWORK_NAME=rsk
PORT=5108

Example:

PRIVATE_KEY=3b9c8ea990c87091eca8ed8e82edf73c6b1c37fe7640e95460cedff09bdf21ff

NOTE: With this .env config file, the email will not be sent to the given address, it will print an url in the console with the URL to preview the "sent" email

Run it

From the root folder, run the following

npm i
npm run setup
npm run serve:test

Backend description

  1. User sends POST /requestVerification/:did { emailAddress }
  2. Service sends email to emailAddress with a verificationCode
  3. User opens mailbox, copies verification code, signs message including the verification code and sends POST /verify/:did { sig }
  4. Services recovers signer address from sig, and compares verificationCode to the sent code. If matches, issues an Email Verifiable Credential

Run it with Docker

Create the .env file with the above guideline, and then run the following

cd back/
docker-compose build
docker-compose up -d

It will expose the api in the PORT described in the .env file

Frontend description

React.js app integrating:

  1. Choose wallet using rLogin
  2. Request email verification
  3. Sign email verification with wallet of choice
  4. Receive email Verifiable credential
  5. Store credential in Data vault using rif-data-vault

email-vc-issuer's People

Contributors

ilanolkies avatar javiesses avatar jessgusclark avatar juan-rsk avatar dependabot[bot] avatar vmandal avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.