This repository holds the OAuth2 OpenID Connect provider based on the excellent node-oidc-provider by panva.
- Docker
- NVM
We use docker to run our dependencies like mongo and hardhat in. We run the development server locally, managing a common node version using Node Version Manager. You can also manually install the correct node version but usage of NVM is recommended.
# 1. Install/activate current nodejs defined in .nvmrc
nvm use
# 2. Provide environment variables
cp .env.example .env
# 3. This readme assumes you have installed the API.
# Copy it's `./certs` folder to the root of this project
or use [mkcert](https://github.com/FiloSottile/mkcert) and run
mdir certs mkcert -key-file certs/localhost.key -cert-file certs/localhost.crt localhost
# 4. Create jwks
npm run build:keys
# 5. Checkout SCSS submodule
git submodule init
git submodule update
# 6. Install packages
npm ci
A thx_hardhat container with prefilled wallets and all required contracts will be deployed automatically.
# 7. Start containers
docker compose up
# 8. Start process
npm start
#Runs all suites
npm test
#Runs a specific test by file name
npm test <file_name_part>
Commonly used for data exchange between client and server. Extend scope
property with required resources.
POST https://localhost:3030/reg
{
"application_type": "web",
"grant_types": ["client_credentials"],
"redirect_uris": [],
"response_types": [],
"scope": "openid"
}
Commonly used for data exchange between servers. Extend scope
property with required resources.
POST https://localhost:3030/reg
{
"application_type": "web",
"grant_types": ["authorization_code"],
"redirect_uris": ["https://localhost:8083/signin-oidc"],
"post_logout_redirect_uris": ["https://localhost:8083"],
"response_types": ["code"],
"scope": "openid"
}
npm run migrate:create name-of-my-migration
A new file will be created inside migrations folder with a corresponding timestamp.
|_ migrations/
|- 20210108114324-name-of-my-script.js
# To get the migration status
npm run migrate:status
# To run your migrations, simply run the command
npm run migrate
# To rollback a migration use the down command
npm run migrate:undo-last