The REST API, exposed by the HMRC API Platform as /userinfo to external clients, aims to provide a specification compliant OpenID Connect implementation. It allows consumers to access user details with consent and in the OpenID Connect UserInfo format.
A typical workflow would be:
- Authenticate.
- Access a user-info resource via GET or POST request
All end points are User Restricted (see authorisation). Versioning follows the API Platform standards (see the reference guide). User details data structures follow the OpenId Connect UserInfo specification (see the specification)
You can dive deeper into the documentation in the API Developer Hub.
Note, the /userinfo endpoint is an external API endpoint. This endpoint requires an API token for authentication.
Method | HMRC API Platform Path | Internal Path | Description |
---|---|---|---|
GET | /userinfo | / | Returns information about an End-User as requested in the openid scopes as documented in the published API document. |
POST | Internal use only | / |
Run the service sbt run -Drun.mode=Dev
Run the tests & test coverage report sbt clean coverage test it/test coverageReport
Run the service in service manager; if you want live endpoints, then start dependencies thus: sm2 --start AUTH DATASTREAM -r
Now you can test the sandbox curl -v http://localhost:9000/sandbox/userinfo -H 'Accept: application/vnd.hmrc.1.0+json'
This code is open source software licensed under the Apache 2.0 License