Defra Forms identity API — a private OIDC identity provider for citizen sign-in to Defra forms.
This service issues and manages identities for form submitters. It is a backend API (Hapi + MongoDB) that sits on a private network; browsers never reach it directly — only other Defra Forms services do.
Please install Node.js >= v22 and npm >= v10. You will find it easier to use the Node Version Manager nvm:
cd forms-identity-api
nvm useInstall application dependencies:
npm installThe API requires a MongoDB replica set. Start one locally (plus mongo-express on http://localhost:8081) with:
docker compose up -d mongoTo run the application in development mode run:
npm run devThe API listens on http://localhost:3010 by default. Check it is running:
curl http://localhost:3010/healthTo test the application run:
npm testTo mimic the application running in production mode locally run:
npm startAll available Npm scripts can be seen in package.json. To view them in your command line run:
npm runnpm run lint
npm run formatTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:
http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3
The following attribution statement MUST be cited in your products and applications when using this information.
Contains public sector information licensed under the Open Government licence v3
The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.
It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.