Hook
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.
Example Usage
using Pulumi;
using Auth0 = Pulumi.Auth0;
class MyStack : Stack
{
public MyStack()
{
var myHook = new Auth0.Hook("myHook", new Auth0.HookArgs
{
Enabled = true,
Script = @"function (user, context, callback) {
callback(null, { user });
}
",
TriggerId = "pre-user-registration",
});
}
}
Coming soon!
import pulumi
import pulumi_auth0 as auth0
my_hook = auth0.Hook("myHook",
enabled=True,
script="""function (user, context, callback) {
callback(null, { user });
}
""",
trigger_id="pre-user-registration")import * as pulumi from "@pulumi/pulumi";
import * as auth0 from "@pulumi/auth0";
const myHook = new auth0.Hook("my_hook", {
enabled: true,
script: `function (user, context, callback) {
callback(null, { user });
}
`,
triggerId: "pre-user-registration",
});Create a Hook Resource
new Hook(name: string, args: HookArgs, opts?: CustomResourceOptions);def Hook(resource_name, opts=None, enabled=None, name=None, script=None, trigger_id=None, __props__=None);public Hook(string name, HookArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args HookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args HookArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HookArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Hook Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Hook resource accepts the following input properties:
- 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
- enabled boolean
Whether the hook is enabled, or disabled
- name string
Name of this hook
Outputs
All input properties are implicitly available as output properties. Additionally, the Hook resource produces the following output properties:
Look up an Existing Hook Resource
Get an existing Hook resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: HookState, opts?: CustomResourceOptions): Hookstatic get(resource_name, id, opts=None, enabled=None, name=None, script=None, trigger_id=None, __props__=None);public static Hook Get(string name, Input<string> id, HookState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- enabled boolean
Whether the hook is enabled, or disabled
- 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
Package Details
- Repository
- https://github.com/pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
auth0Terraform Provider.