37d3cbbdf4
Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.3...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.. | ||
src | ||
README.md | ||
env.sh | ||
oauth-for-chronograf.sh | ||
package.json | ||
yarn.lock |
README.md
oauth2-server-mock
This repository contains a mock OAuth2 Authorization Server with Authorization Code Grant flow and OpenID UserInfo endpoint. It is primarily intended for testing, it always authorizes a pre-configured user that can be changed at runtime.
Install
Prerequisites: node.js 14 or newer
Install required dependencies using your favorite package manager yarn:
yarn
Configure
Modify ./env.sh and run source env.sh
to setup initial configuration of the OAuth2 Mock Server.
Start
yarn start
Initial configuration is printed to console as well as the URL where the server is listening for requests.
Chronograf Setup
Chronograf can use this OAuth2 Mock server as a generic OAuth2 authentication provider, several environment variables must be set before starting chronograf. These variables are shown in ./oauth-for-chronograf.sh.
Change OAuth2 redirect or authorized user at runtime
The running OAuth2 Mock server exposes a simple UI that let you change name/email of the authorized user, and a redirect URL after authorization. This page is by default accessible at http://localhost:8087/ .
Alternatively a simple HTTP POST message can be sent to change the config:
curl -X POST http://localhost:8087/config -H 'Content-Type: application/json' -d '{
"redirect_uri": "http://whatever.you.like/callback",
"userinfo": { "name": "fred doe", "email": "fred.doe@fake.net" }
}'