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 this problem is due to an attribute of a user (namely their location), use a 4xx response code to indicate a user issue. The 451 response code has been suggested for use in cases where content cannot be displayed for legal reasons.
Steps
-
From the PingAuthorize Policy Editor, go to the Policies tab.
-
Select Users viewing shared memes.
-
Click Statements.
-
Click Add Statement and select Denied Reason.
-
For the name, replace Untitled with
Send "not permitted" error
. -
From the Applies to drop-down list, select Deny.
-
For a Payload value, enter
\{"status": 451, "message": "Restricted", "detail": "Not permitted per regulation"}
. -
Click Save changes.
Result:
You have a new statement, which looks something like the following image.