Application cannot be used for user registration

When I try to create user from the endpoint 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

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?

1 Like
    NewAuth0User user = new NewAuth0User
        email = "",
        blocked = false,
        email_verified = false,
        given_name = "MyName",
        family_name = "MySurname",
        name = "MyName MySurname",
        nickname = "myNick",
        picture = "",
        user_id = "abcd12345",
        verify_email = false,
        password = "mypassword",
        app_metadata = new { },
        user_metadata = new { },
        connection = "Username-Password-Authentication"

var client = new RestClient(“”);
var request = new RestRequest(Method.POST);
request.AddHeader(“authorization”, $“Bearer {mytoken}”);
return await client.ExecuteAsync(request);

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

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

Sure… the tenant name is dev--z8ui6zz

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

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.

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

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

Thank you… It worked!!!

1 Like

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