An example implementation of an OpenID Connect relying party that connects to the GOV.UK One Login OpenID provider in javascript using node.js and Typescript
This consists of four interrelated services belonging to a hypothetical department of Camelids that demonstrates some of the key concepts of integration with GOV.UK One Login:
| service | type | description |
|---|---|---|
| Camelid dashboard | auth only | a dashboard service for all camelids |
| Dromedary directory | ? | a directory of dromedaries |
| Llama ledger | ? | a ledger of llamas |
| Alpaca tracker | auth + idv | a tracker for alpacas |
DIAGRAM
Description of the diagram
This requires that you have:
- a set of four OpenID client IDs for the services configured appropriately against the integration environment
- the required software dependencies to run the example, homebrew, node.js, typescript, direnv, visual studio code, visual studion extensions
- test data to allow you to prove an identity
The four service all require their own OpenID Connect client ID configured in the integration environment.
Because all these services require control of the sector id or require the use of the identity service they must be manually configured against integration and are not able to use the self service admin tool which only supports auth only,
- get client ID for Camelid dashboard
- get client ID for Dromedary directory
- get client ID for Llama ledger
- get client ID for Alpaca tracker
Assuming you are using MacOS
| tool | instructions |
|---|---|
| homebrew | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| node.js | brew install node |
| direnv | brew install direnv |
| typescript | brew install typescript |
| ts-node | npm install -g ts-node |
| Visual Studio Code | visual-studio-code |
| Visual Studio Code extensions |
git clone https://github.com/philf999/di-rp-referencegit checkout camelscd di-rp-reference/clients/nodejs
- copy template environment settings
- configure environment settings
- prepare IDE
- run directory service
- signup
- access directory
- navigate to other service
- signup with identity
- assess service
- navigate to third service
- authentiate using login sharing the identity
...