# Authenticate calls from auth0 hooks to my server

**URL:** <https://community.auth0.com/t/authenticate-calls-from-auth0-hooks-to-my-server/42684>\
**Category:** Get Help\
**Tags:** hooks\
**Created:** [May 8, 2020, 10:02pm UTC](https://community.auth0.com/t/authenticate-calls-from-auth0-hooks-to-my-server/42684 "2020-05-08T22:02:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![app.charttt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/app.charttt/32/13532_2.png) [@app.charttt](https://community.auth0.com/u/app.charttt)\
**Post date:** [May 8, 2020, 10:02pm UTC](https://community.auth0.com/t/authenticate-calls-from-auth0-hooks-to-my-server/42684/1 "2020-05-08T22:02:22Z")

</div>

I want to call my server from postRegistration hook.  
I can write my own authentication layer for that, but I guess there’s already something that I can use.  
The hook function looks like this: function (user, context, cb)

Looking at the context object, I’ve found that all of the following contain the same secret:  
context.webtask.data.auth0-extension-secret  
context.webtask.headers.authorization  
context.webtask.meta.auth0-extension-secret  
context.webtask.secrets.auth0-extension-secret

And all of the following contain the same jwt:  
context.webtask.headers.x-wt-token  
context.webtask.storage.backchannel.requestDefaults.headers.authorization  
context.webtask.storage.backchannel.token  
context.webtask.storage.token

I’m not even sure what fields from the context am I supposed to be using. Most of it looks like details of the request between auth0 and [webtask.io](http://webtask.io) (the service that auth0 are using to run my hook script)

So - can I use the secret or JWT as authentication to my own server? If I can, which path in the context should I prefer?

Thanks

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 11, 2020, 9:26pm UTC](https://community.auth0.com/t/authenticate-calls-from-auth0-hooks-to-my-server/42684/4 "2020-05-11T21:26:43Z")

</div>

Welcome to the Community @app.charttt!

To make the call between your hook and server, you should be using a M2M flow. Check out this FAQ about making the call from a rule, it is a very similar scenario:

[http://community.auth0.com/t/how-do-i-call-my-api-from-a-rule/41309](http://community.auth0.com/t/how-do-i-call-my-api-from-a-rule/41309)

---

<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:** [May 26, 2020, 9:26pm UTC](https://community.auth0.com/t/authenticate-calls-from-auth0-hooks-to-my-server/42684/5 "2020-05-26T21:26:44Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
