Hooks are secure, self-contained functions that allow you to customize the behavior of Auth0 when executed for selected extensibility points of the Auth0 platform. Auth0 invokes Hooks during runtime to execute your custom Node.js code. Depending on the extensibility point, you can use hooks with Database Connections and/or Passwordless Connections.
resource "auth0_hook" "my_hook" {
name = "My Pre User Registration Hook"
script = <<EOF
function (user, context, callback) {
callback(null, { user });
}
EOF
trigger_id = "pre-user-registration"
enabled = true
secrets = {
foo = "bar"
}
dependencies = {
auth0 = "2.30.0"
}
}
function (user, context, callback) {
callback(null, { user });
}
EOF
trigger_id = "pre-user-registration"
enabled = true
secrets = {
foo = "bar"
}
dependencies = {
auth0 = "2.30.0"
}
}
name
(String) Name of this hook.script
(String) Code to be executed when this hook runs.trigger_id
(String) Execution stage of this rule. Can be credentials-exchange, pre-user-registration, post-user-registration, post-change-password, or send-phone-message.dependencies
(Map of String) Dependencies of this hook used by the WebTask server.enabled
(Boolean) Whether the hook is enabled, or disabled.secrets
(Map of String, Sensitive) The secrets associated with the hook.id
(String) The ID of this resource.Import is supported using the following syntax:
# This resource can be imported by specifying the hook ID.
#
# Example:
terraform import auth0_hook.my_hook "00001"