PingAuthorize

Creating a statement to provide a more useful error message

Add a command, known as a statement, that instructs PingAuthorize to set the HTTP response code and provide a more useful error message when rejecting the outbound response.

About this task

Because the reason for denial is a user attribute (the user’s location), use a 4xx response code to indicate a user issue. The 451 status code is commonly used when content is unavailable because of legal restrictions.

Steps

  1. In the Policy Editor, click Policies.

  2. Select Users viewing shared memes.

  3. Click Statements.

  4. Click Add Statement and select Denied Reason.

  5. For the name, replace Untitled with Send "not permitted" error.

  6. In the Applies to list, select Deny.

  7. In the Payload field, enter {"status": 451, "message": "Restricted", "detail": "Not permitted per regulation"}.

  8. Click Save changes.

    Result:

    You have a new statement that looks like the following image:

    Screen capture showing a denied-reason statement with a user-friendly error message.