Setting the Error Value Returned when Denying Access within Auth0 Action via "api.access.deny"

Overview

This article explains whether it is possible to set the error value or the error code returned when denying access within a post-login action via api.access.deny.

Applies To

  • Action
  • post-login trigger
  • api.access.deny

Solution

It is not possible to do this. The error_description value returned will be the message passed to api.access.deny, but the error parameter will always have the value of access_deniedand the error code will be HTTP 400.

Sample code in Action:

api.access.deny("Login failed.");


The sample error response:

HTTP 400
{"error":"access_denied","error_description":"Login failed."}


To suggest this functionality in a future release of Auth0, please submit a feature request using our Product Feedback form.

Recommended content

No recommended content found...