# How can I test a post-registration-webhook?

**URL:** <https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274>\
**Category:** Get Help\
**Tags:** test, tier1, testing, hooks\
**Created:** [September 22, 2017, 7:55am UTC](https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274 "2017-09-22T07:55:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![diego](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@diego](https://community.auth0.com/u/diego)\
**Post date:** [September 22, 2017, 7:55am UTC](https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274/1 "2017-09-22T07:55:28Z")

</div>

I need to test a webhook, I’ve tried the Runner panel and manually setting up a request to a http address but it didn’t requested that URL.

This is what my code looks like:

```
module.exports = function (user, context, cb) {
  const request = require('request');
  request({
    uri: 'http://06d22973.ngrok.io/hooks/users',
    method: 'POST',
    form: {
     user, context
    }
  }, cb)
};

```

---

<div class="post-metadata">

**Author:** ![swapna.dixit](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@swapna.dixit](https://community.auth0.com/u/swapna.dixit)\
**Post date:** [September 22, 2017, 5:37pm UTC](https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274/2 "2017-09-22T17:37:53Z")

</div>

While executing the code using runner, did you save it as described in the link below:

> **[Post-User Registration](https://auth0.com/docs/customize/hooks/extensibility-points/post-user-registration)**
>
> Learn how hooks can be used with the Post-User Registration extensibility point, which is available for database connections and passwordless connections.

---

<div class="post-metadata">

**Author:** ![diego](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@diego](https://community.auth0.com/u/diego)\
**Post date:** [September 23, 2017, 2:10am UTC](https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274/3 "2017-09-23T02:10:16Z")

</div>

Oh, my bad … I had not saved it. Now I have another question, how can I trust the request actually comes from Auth0? I’ve looked at headers and there are some Bearer Bearer tokens and x-auth0-secret like ones but can’t see any particular token or key at dashboard I can use to compare and verify the POST actually comes from Auth0

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [September 25, 2017, 7:13pm UTC](https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274/4 "2017-09-25T19:13:13Z")

</div>

As mentioned in the comments and for greater visibility and the benefit of others do ensure that the code is saved in the editor.

In relation to ensuring that a request made from a hook to an external URL is indeed coming from the hook itself and not from some other source this will depend more on the external URL then any hook specific limitation.

The hook is just Javascript code that is mostly equivalent to running the same set of code from within Node.js; this means that the same methods of authenticating a request coming from a Node.js script is available to code associated with a hook.

In particular, you can choose to accept a secret or API key in your external URL and then configure the hook to send this API key as part of the request. If the external URL accepts a bearer access token following OAuth2 rules then the hook can also act as a confidential client application and perform a client credentials grant to obtain an access token for that external URL and then send the token with the final request.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/how-can-i-test-a-post-registration-webhook/8274/5 "2018-03-02T05:56:38Z")

</div>


