Email Verifiable Credential issuer.
This service allows the controller of a decentralized identity to verify your email address.
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
From the root folder, run the following
npm i
npm run setup
npm run serve:test
- User sends
POST /requestVerification/:did { emailAddress }
- Service sends email to
emailAddress
with averificationCode
- User opens mailbox, copies verification code, signs message including the verification code and sends
POST /verify/:did { sig }
- Services recovers signer address from
sig
, and comparesverificationCode
to the sent code. If matches, issues an Email Verifiable Credential
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
React.js app integrating:
- Choose wallet using
rLogin
- Request email verification
- Sign email verification with wallet of choice
- Receive email Verifiable credential
- Store credential in Data vault using
rif-data-vault