Skip to main content

FAPI-RW-ID2-ENSURE-DIFFERENT-NONCE

NameVerifies behaviour related to supplying a nonce on an endpoint different to a request
CategoryINFOSEC
Execution MethodAUTOMATED (FAPI BASELINE)
Preconditions
Description

This test passes a different nonce in the authorization_endpoint parameters to the one inside the signed request object. The authorization server must either return an invalid_request error back to the client, and must show an error page (saying the request object is invalid as the 'nonce' value in the request object and outside it are different - upload a screenshot of the error page), or must successfully authenticate and return the nonce from inside the request object in the id_token.

Steps
  1. Retrieve Discovery Document and parse required endpoints
  2. Retrieve JWKS Key Set using jwks_uri attribute
  3. Validate JWKS keys are valid JSON, contain the required fields and are correctly encoded using unpadded base64url
  4. Verify all JWKS keys contain kids
  5. Verify all JWKS keys do not contain any private or symmetric keys
  6. Verify all JWKS keys are at least 2048 bits in length
  7. Verify JWKS contains at least one key with alg of PS256 or ES256
  8. Create authorisation request with content of (roughly) similar to:
  9. {
      "aud": "https://localmachine:8103/local-conformance-holder",
      "scope": "openid profile bank:accounts.basic:read bank:accounts.detail:read",
      "claims": {
          "sharing_duration": 7776000,
          "id_token": {
              "acr": {
                  "value": "urn:cds.au:cdr:2",
                  "essential": true
              }
          }
      },
      "iss": "4unxLnjKSMQCTRYU1X1Bed",
      "response_type": "code id_token",
      "redirect_uri": "https://localhost.emobix.co.uk:8443/test/a/wikkitgate/callback",
      "state": "LwI4CZHGDm",
      "exp": 1603332124,
      "nonce": "vVqWbuseiL",
      "client_id": "4unxLnjKSMQCTRYU1X1Bed"
    }
  10. Serialise the authorisation request without signing it with any cryptographic signature
  11. Create a client assertion containing iss, sub, jti, iat, exp and aud
  12. Sign the client assertion using PS256
  13. Dispatch the authorisation request (9) using the client assertion (11) to the pushed_authorization_request_endpoint specified within the discovery document
  14. Verify the PAR endpoint returned HTTP Status 201 with a valid_request_url returned.
  15. Verify that the content of the request uri meets entropy of at least 128-bits
  16. Initiate a browser initiation to the authorize endpoint specifying a query string of:
    • request_uri retrieved in (13)
    • client_id matching the iss of the authorisation request
    • redirect_uri matching the authorisation request
    • scope specifying scopes matching the authorisation request
    • response_type of code id_token
    • nonce containing different data to that specified in (8)
  17. Either the server produces:
    • An error page indicating an invalid nonce
    • An OAuth2 error redirect of invalid_request type
    • Ignores the nonce used in the query string of (15) and proceeds with the authorisation providing the nonce from the request object
Inputs
Expected ResultsThe Holder must either complain about mismatched nonce's or ignore the nonce specified in the authorisation request query string