--- openapi: 3.0.3 info: title: Account Management Components OAuth Provider Public API version: 0.0.17 description: | OAuth 2.0 provider endpoints, including: - GET /authorize contact: name: GDS - DI Accounts Pod - Home Team email: one-login-home-team@digital.cabinet-office.gov.uk license: name: MIT url: https://github.com/govuk-one-login/account-components/blob/main/LICENSE.md tags: - name: OAuth description: |- Methods to gain access to Account Management Component Journeys. **Note:** This functionality is intended to be used by systems solely belonging internally to GDS DI. servers: - url: https://manage.dev.account.gov.uk description: public development server - url: https://manage.build.account.gov.uk description: public build server - url: https://manage.staging.account.gov.uk description: public staging server - url: https://manage.integration.account.gov.uk description: public integration server - url: https://manage.account.gov.uk description: public production server paths: /authorize: get: summary: Authorization endpoint operationId: authorize security: [] tags: - OAuth description: | Initiates an OAuth 2.0 Authorization Code flow using a JWT Secured Authorization Request (JAR) per RFC 9101. The authorization server will redirect the user-agent back to the client's redirect URI with an authorization code. This endpoint ONLY accepts JAR Request Objects. All authorization request parameters MUST be conveyed inside a signed Request Object JWT that is been encrypted (`request`). The authorization server MUST: - Decrypt the JAR using it's private key. - Verify claims and query string parameters - Validate the Request Object signature with the client's registered key and supported algorithms. - Validate standard claims (`iss`, `aud`, `exp`, `iat`, and optionally `jti`). - Use the parameters contained INSIDE the Request Object; any duplicated top-level query parameters MUST be ignored. - Enforce any server policies (e.g., allowed `redirect_uri`, required `response_type` == `code`, required `scope`, etc.). parameters: - $ref: "#/components/parameters/ResponseType" - $ref: "#/components/parameters/ClientId" - $ref: "#/components/parameters/Scope" - $ref: "#/components/parameters/RedirectUri" - $ref: "#/components/parameters/RequestObjectJAR" - $ref: "#/components/parameters/State" responses: "302": description: Redirect the user agent to the redirect URI headers: Location: description: Redirect URI with `code` and `state` on journey completion, or `error`, `error_description` and `state` parameters if authorization fails. schema: format: uri type: string examples: success: value: https://signin.account.gov.uk/callback?code=anAuthCode&state=aRandomString alg_not_allowed: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1001&state=aRandomString jws_invalid: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1002&state=aRandomString jws_signature_verification_failed: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1003&state=aRandomString jwt_invalid: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1004&state=aRandomString jwt_expired: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1005&state=aRandomString jwt_claim_validation_failed: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1006&state=aRandomString verify_jwt_error: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1007&state=aRandomString invalid_claims: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1008&state=aRandomString jar_decrypt_failed: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1009&state=aRandomString jti_already_used: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1010&state=aRandomString cookie_for_checking_user_agent_not_set: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1011&state=aRandomString user_agent_mismatch: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1012&state=aRandomString required_claims_missing: value: https://signin.account.gov.uk/callback?error=invalid_request&error_description=E1013&state=aRandomString jwks_timeout: value: https://signin.account.gov.uk/callback?error=unauthorized_client&error_description=E2001&state=aRandomString jwks_invalid: value: https://signin.account.gov.uk/callback?error=unauthorized_client&error_description=E2002&state=aRandomString jwks_no_matching_key: value: https://signin.account.gov.uk/callback?error=unauthorized_client&error_description=E2003&state=aRandomString jwks_multiple_matching_keys: value: https://signin.account.gov.uk/callback?error=unauthorized_client&error_description=E2004&state=aRandomString jwk_invalid: value: https://signin.account.gov.uk/callback?error=unauthorized_client&error_description=E2005&state=aRandomString failed_to_check_jti_unused: value: https://signin.account.gov.uk/callback?error=server_error&error_description=E3001&state=aRandomString verify_jwt_unknown_error: value: https://signin.account.gov.uk/callback?error=server_error&error_description=E3002&state=aRandomString jar_decrypt_unknown_error: value: https://signin.account.gov.uk/callback?error=server_error&error_description=E3003&state=aRandomString failed_to_start_session_and_go_to_journey: value: https://signin.account.gov.uk/callback?error=server_error&error_description=E3004&state=aRandomString components: parameters: ResponseType: in: query name: response_type required: true schema: type: string enum: - code example: code ClientId: in: query description: Supplied during Client Registration name: client_id required: true schema: type: string pattern: ^[A-Fa-f0-9]{32}$ example: ABCDEF12345678901234567890123456 # pragma: allowlist secret RedirectUri: in: query description: After a user successfully authorizes an application, the authorization server will redirect the user back to the application using this URI. name: redirect_uri required: true schema: type: string format: uri pattern: ^(https|http)://(www\.)?((localhost(:[0-9]+)?)|[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b)([-a-zA-Z0-9()@:%_+.~#?&/=]*)$ example: https://signin.account.gov.uk/callback Scope: in: query name: scope description: One or more Scope values separated by single spaces required: true schema: type: string pattern: ^[a-z]+(?:-?[a-z]+)*(?:\s[a-z]+(?:-?[a-z]+)*)*$ example: account-delete RequestObjectJAR: in: query name: request description: | The Request Object that holds authorization request parameters stated [in the table in step 4 of the High Level Process Description](https://govukverify.atlassian.net/wiki/spaces/DID/pages/5654708312/High+Level#Process-Description). Expected JWT claims: - `client_id` (string): Client identifier, must match the client_id query parameter - `iss` (string): Issuer, must match client_id - `aud` (string): Audience, must be the authorize endpoint URL - `response_type` (string): Must be "code" - `exp` (number): Expiration time - `iat` (number): Issued at time, must not be in the future - `redirect_uri` (string): Redirect URI, must match the redirect_uri query parameter - `scope` (string): Requested scope, must match the scope query parameter - `state` (string, optional): CSRF protection state, must match the state query parameter - `jti` (string): JWT ID, must be unique - `account_management_api_access_token` (string, optional): Access token for stubbed account management API, used to determine which canned response to return. Only needed when calling the stubbed account management API instead of the real one. - `account_data_api_access_token` (string, optional): Access token for account data API - `account_interventions_service_api_access_token` (string, optional): Access token for stubbed account interventions service API, used to determine which canned response to return. Only needed when calling the stubbed account interventions service API instead of the real one. - `internal_api_access_token` (string, optional): Access token for stubbed internal API, used to determine which canned response to return. Only needed when calling the stubbed internal API instead of the real one. - `sub` (string): Internal pairwise identifier - `public_sub` (string): Public subject identifier - `email` (string): User email address - `channel` ("web" | "strategic_app" | "generic_app", optional): Channel the user is coming via (defaults to "web") required: true schema: type: string example: eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwia2lkIjoicnNhS2lkMTIzIn0.RD5GmRxN6FYnpJlBkpHPipkjqitgFe2srZFGWDs0jL5oP2vDhf6Bzp5Vfm3uGU_H0uzo_kEAF0tWLA-5N7k9CqNzW_Lc8iN_uxyPCv_9SuPmeCYQyGJckBwE7LO9eBIrLrMEVFL6ei7O0T3o7MlKUcJFtd1D7hh_Kyb9Fejb0H5YeE2hDdjTzkxpAVHx3pWzhW1BHInluamX3EpFMCYsYrwA5v8PHJ2UZW-q4VKlmzvdjrhj_7q4RZPg9rei8bS0jpL1GNr-qj2UiQWsVjx7lXNS8qpxlkpof4LkC9XKQdFEPOJTsNL7ksf57YgwvH4EdV7codNPdZ38qEwh-8F-SA.VPsK7-RRH0OzoDiG.dWGngx419R465g7KVrrpU66HfxI5LzvyZV5ejprj1lLW9AtXq_rXeEKoMf5_Vj3lkQ_b5biQWUcdtdJ0xeeX0Iqhkya_DrHE_aocDSYY0U_W_EdjtolXavLF_vMpdXLiyOab5vTZXlcOl5jMRLjkqOCU5HKoLhyYjcvHzVtA9dRGQnhuQa462BjV4YZbXDtciU6EC8e6OZ_XXO3R9lZ7pN9lZMeaer6ThYgsdyiJfI82A_FAvFLcBWCO4xs1BEyGCt1ltXJNosEFeM_PPqiQ59WyNUy6kdiXrm6GeFKoOUwz3HCFuNd3VfJs-oBSt4o9e6tUSuQimmoamhDHcb6eguevv1TxoXlNqg1Y1X48UXwvH0NjpFkS3RyZcdY5vZmQvD51lvfbEvyUzNk31k-2mrfLZ2XrWJZJ77GKvifYfUufX1IzIQbRdyNj54nDsOKcPZe7KIFLs4rd-ZTX4SqEqpYRFwnXWUlEt689E-hQOUgm9nvAH4GZeWGByrnw8yuYmOC6MI6yfkavBhxOYKzRms47Hf308r6k6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qZ8UbvfhqkbcSZwziJMOOzaSoMY9H8t59aZZIZAdZsvFv1nVYVYCoovK0V_QWMsX-vWq6mBjbD0nFWcSnSo_mgdI8Olb46kJuJ90ymV36BIbcPehF3_5Q0FM3jTlZAwoXUHFbtu5Genfnp0z6cid_FtgAXVlEdTEjtuY19RbYCwqXPOUO_A_T_UnbCd5dzWyxuFGxEz_5XQPcJfLZZ855oEK9RJMRhbyl_v6t4dqchjyGG8v0BFX9ompGJczUERT-vXyCcCgWWjIal2OOcuL57jHuORrGnI6J1_6fNHBs1uah2p5WQy6DPkCHrhKA8PEv-KxuvS8fO0L36SV_OuBzMd5Y0d5XFiS4o8Ux9jTCsXTv81sXWgAb_VmZbZ0GHd6.4q4viJNZyy_T6N-mIdHgjQ # pragma: allowlist secret State: in: query name: state description: Essential for protecting against Cross-Site Request Forgery (CSRF) attacks by ensuring that the response from the authorization server matches the original request. required: false schema: type: string example: aRandomString123