1.0.11 • Published 5 years ago

oidc-issuer-example v1.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

oidc-example-issuer

A directory you rename to create node oidc-lib credential issuer services

Install

git

$ git clone https://github.com/kimcameron/oidc-example-issuer

The resulting directory contains the scaffolding for node-based verifiable credential issuers - as well as a wallet to hold the credentials and make them usable.

$ ls -l
-rw-rw-r--   1 musicmula musicmula   1060 Nov 18 18:56 LICENSE
-rw-rw-r--   1 musicmula musicmula     96 Nov 18 18:56 README.md
drwxrwxr-x   2 musicmula musicmula   4096 Nov 18 18:56 examples
-rw-rw-r--   1 musicmula musicmula    159 Nov 18 18:56 index.js
drwxrwxr-x 454 musicmula musicmula  20480 Nov 19 18:29 node_modules
drwxrwxr-x   3 musicmula musicmula   4096 Nov 18 22:56 oidc_lib_data
-rw-rw-r--   1 musicmula musicmula 166504 Nov 19 18:29 package-lock.json
-rw-rw-r--   1 musicmula musicmula    466 Nov 19 18:28 package.json
drwxrwxr-x   2 musicmula musicmula   4096 Nov 18 21:08 src
drwxrwxr-x   3 musicmula musicmula   4096 Nov 18 18:56 views
drwxrwxr-x   6 musicmula musicmula   4096 Nov 18 22:58 web

Next run 'npm install'.

$ npm install

This populates a node_modules sub directory containing oidc-lib and all its dependencies. It will also set up a demo https server to host your credential issuers. At the end of 'npm install' you will be asked if want this server to use the demo domain of 'virtual.itsourweb.org'. If you say no, it will give you the option of configuring a different subdomain of 'itsourweb.org' (for example, 'mydomain.itsourweb.org'). Or, you can opt to use your own dns domain, in which case you have to obtain an https certificate and follow the instructions below for installing it.

##Setting up DNS or the hosts file If you used your own domain name and certificate in the previous step you need to make sure that DNS routes to the server hosting oidc-example-issuer. If using an 'itsourweb.org' domain for demo purposes, the simplest way to get things going is to edit the hosts file on your server (or other computers on your network) to point to the server on which oidc-example-issuer is running.

For example, on Ubuntu, edit /etc/hosts to include your demo domain:

$cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 mydomain.itsourweb.org

On windows, you edit /windows/system32/drivers/etc/hosts as administrator:

C:\windows\system32>type drivers\etc\hosts
# localhost name resolution is handled within DNS itself.
#       127.0.0.1       localhost
         127.0.0.1      mydomain.itsourweb.org

##Testing the service

$ node index

oidc_lib starting up at Fri Nov 20 2020 04:47:30 GMT+0000 (Coordinated Universal Time)
Initializing FileDb in content module sts
Keys loaded and ready to start server
Https server started on port 3000
Http server started on port 3001

Importing a demo credential issuer

Use Control-C or equivalent to terminate the service, and import a demo credential issuer so you can try issuing a credential into a wallet.

Example credential issuers are included in the 'examples' sub directory to make it easier to understand how simply the system works.

Use npm from your oidc-examples-issuer directory to import a credential issuer:

$ npm run import

What package file contains the credential issuer you want to add?
examples/covid_cred.json
The credential issuer is currently called "covid_cred". You can change it's name but will have to rename and edit 'covid_cred.js'
Press "Y" to change the issuer name, or "N" to retain it. (Y/N) N
Press "Y" to proceed, "N" to exit. (Y/N) Y

Startup with credential issuers

Now start the system with the credential issuer installed:

$ node index

oidc_lib starting up at Fri Nov 20 2020 04:47:30 GMT+0000 (Coordinated Universal Time)
Loaded content module: covid_cred
Initializing FileDb in content module sts
Initializing FileDb in content module covid_cred
[ClientLib] Success loading keystore - covid_cred:privateOmniKey
[ClientLib] Success loading keystore - covid_cred:integrityKey
Keys loaded and ready to start server
Https server started on port 3000
Http server started on port 3001

Creating a wallet

The issuer is now working, so start up a wallet.

Begin by running chrome on the same computer as the service is running on. Browse to:

https://mydomain.itsourweb.org:3000/wallet/wallet.html
1.0.11

5 years ago

1.0.10

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago