# Application cannot be used for user registration

**URL:** <https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409>\
**Category:** Get Help\
**Created:** [September 28, 2021, 1:05pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409 "2021-09-28T13:05:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [September 28, 2021, 1:05pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/1 "2021-09-28T13:05:32Z")

</div>

When I try to create user from the endpoint https://my\_tenant.eu.auth0.com/api/v2/users I get the following response:

{“statusCode”:400,“error”:“Bad Request”,“message”:“Sandbox Error: App ‘My\_App’ cannot be used for user registration.”}

In the Auth0 Management API section, Machine to Machine Applications My\_App (Blazor Server web application) is correctly authorized to use managment API ad to create users

---

<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:** [September 29, 2021, 10:09pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/3 "2021-09-29T22:09:42Z")

</div>

Hi @gianluca.biasini,

Welcome to the Auth0 Community!

Can you post the request you are making? In addition, you can confirm that the client ID, domain, and scopes are all correct?

---

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [September 30, 2021, 10:48am UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/4 "2021-09-30T10:48:35Z")

</div>

```
    NewAuth0User user = new NewAuth0User
    {
        email = "mymail@gmail.com",
        blocked = false,
        email_verified = false,
        given_name = "MyName",
        family_name = "MySurname",
        name = "MyName MySurname",
        nickname = "myNick",
        picture = "https://secure.gravatar.com/avatar/15626c5e0c749cb912f9d1ad48dba440?s=480&r=pg&d=https%3A%2F%2Fssl.gstatic.com%2Fs2%2Fprofiles%2Fimages%2Fsilhouette80.png",
        user_id = "abcd12345",
        verify_email = false,
        password = "mypassword",
        app_metadata = new { },
        user_metadata = new { },
        connection = "Username-Password-Authentication"
    };

```

var client = new RestClient(“[https://mytenant.eu.auth0.com/api/v2/users](https://mytenant.eu.auth0.com/api/v2/users)”);  
var request = new RestRequest(Method.POST);  
request.AddHeader(“authorization”, $“Bearer {mytoken}”);  
request.AddJsonBody(user);  
return await client.ExecuteAsync(request);

---

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [September 30, 2021, 10:50am UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/5 "2021-09-30T10:50:15Z")

</div>

> [@dan.woda](#):
>
> Can you post the request you are making? In addition, you can confirm that the client ID, domain, and scopes are all correct?

Yes… I use the same to get all users… and it works fine

---

<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:** [September 30, 2021, 5:44pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/6 "2021-09-30T17:44:26Z")

</div>

Can you please DM me the name of your tenant so I can look at the logs?

---

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [October 1, 2021, 6:46am UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/7 "2021-10-01T06:46:00Z")

</div>

Sure… the tenant name is `dev--z8ui6zz`

---

<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:** [October 1, 2021, 3:54pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/8 "2021-10-01T15:54:21Z")

</div>

I don’t see a machine to machine app authorized for the management API in your tenant.

---

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [October 2, 2021, 12:40pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/9 "2021-10-02T12:40:43Z")

</div>

![image](https://global.discourse-cdn.com/auth0/original/3X/e/a/ea68288be515110e3e7e88459580fa677226d051.png)

---

<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:** [October 4, 2021, 3:52pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/10 "2021-10-04T15:52:34Z")

</div>

It looks like this error is coming from one of your Pre registration actions. This makes sense, as I can’t find any record of this error message otherwise.

---

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [October 4, 2021, 5:05pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/11 "2021-10-04T17:05:14Z")

</div>

In pre-registration actions, I prevent people to sign in.

I need that only administrator is able to create users

I think this is the issue

---

<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:** [October 4, 2021, 6:14pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/12 "2021-10-04T18:14:06Z")

</div>

You will need to add the name of the application to the `allowedApps` array in the Action.

---

<div class="post-metadata">

**Author:** ![gianluca.biasini](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gianluca.biasini/32/15967_2.png) [@gianluca.biasini](https://community.auth0.com/u/gianluca.biasini)\
**Post date:** [October 5, 2021, 5:51am UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/13 "2021-10-05T05:51:41Z")

</div>

Thank you… It worked!!!

---

<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:** [December 23, 2021, 5:01pm UTC](https://community.auth0.com/t/application-cannot-be-used-for-user-registration/70409/14 "2021-12-23T17:01:03Z")

</div>

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