# Client Credentials Authentication via Pre-register Auth0 hook

**URL:** <https://community.auth0.com/t/client-credentials-authentication-via-pre-register-auth0-hook/58711>\
**Category:** Get Help\
**Tags:** client-credentials-g, hooks, auth0\
**Created:** [March 1, 2021, 8:37pm UTC](https://community.auth0.com/t/client-credentials-authentication-via-pre-register-auth0-hook/58711 "2021-03-01T20:37:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orfen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/orfen/32/27595_2.png) [@Orfen](https://community.auth0.com/u/Orfen)\
**Post date:** [March 1, 2021, 8:37pm UTC](https://community.auth0.com/t/client-credentials-authentication-via-pre-register-auth0-hook/58711/1 "2021-03-01T20:37:21Z")

</div>

Hello, in my previous [post](https://community.auth0.com/t/invitation-only-flow-with-password-setting-and-or-social-logins/57852/4) I was after an invitation system using the Auth0 framework, but in the end we decided to manage the invites ourselves. We’ve set up our API as a regular web app, and i’m trying to get a client credentials token for it through the pre-register web hook to authenticate the hook for the check for pending invites on our API, which is configured with Post Token Endpoint Authentication Method . I’ve tried creating a seperate API to represent the Auth0 hooks and use those client credentials to get a jwt but I’m always faced with 401 errors. Could you tell me what the proper way to set this up on the Auth0 dashboard and what a proper request to the token endpoint would like like because I’m having issues finding the solution.

Thank you

---

<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:** [March 2, 2021, 4:53pm UTC](https://community.auth0.com/t/client-credentials-authentication-via-pre-register-auth0-hook/58711/3 "2021-03-02T16:53:34Z")

</div>

Hi @Orfen ,

You will treat your pre-reg hook as a M2M application.

If you have already done this, you may just need to authorize your M2M application to request tokens for your API. You can do that by going to your M2M application settings, _APIs_, and toggling your API to _Authorized_.

A similar flow is described in this FAQ. [How do I call my API from a rule?](https://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:** [March 17, 2021, 4:53pm UTC](https://community.auth0.com/t/client-credentials-authentication-via-pre-register-auth0-hook/58711/4 "2021-03-17T16:53:52Z")

</div>

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