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
-
In the Policy Editor, click Policies.
-
Select Users viewing shared memes.
-
Click Statements.
-
Click Add Statement and select Denied Reason.
-
For the name, replace Untitled with
Send "not permitted" error
. -
In the Applies to list, select Deny.
-
In the Payload field, enter
{"status": 451, "message": "Restricted", "detail": "Not permitted per regulation"}
. -
Click Save changes.
Result:
You have a new statement that looks like the following image: