Hello.
I’m trying to create a new user with Auth0 Laravel SDK, and I’m in a trouble now.
use Auth0\Laravel\Facade\Auth0;
$management = app('auth0')->management();
$users = $management->users();
$users->create(
connection: 'Username-Password-Authentication',
body: [
'email' => 'example@co.jp',
'password' => 'string',
]
);
No users are created with above code.
The status code is 200.
In my “Machine to Machine” Application’s setting, Management API is authorized.
And “create:users” permission is allowed.
I’ve added several variables to .env.
AUTH0_DOMAIN = Domain of Machine to Machine
AUTH0_CLIENT_ID = Clinet ID of Machine to Machine
AUTH0_CLIENT_SECRET = Clinet Secret of Machine to Machine
AUTH0_AUDIENCE = Identifier of Management API
Incidentally, I can update existed user with following code.
$management = app('auth0')->management();
$users = $management->users();
$users->update(
id: auth()->id(),
body: [
'name' => $request->name,
]
);
I’m new to Auth0, so I apologize in advance if there are any elementary mistakes or lack of knowledge.
I would be grateful if someone could kindly help me.
If more informations are needed, please let me know.