Creating users in terraform needs the client 'id' which is not available

We use an m2m client to access the management APIs during a terraform deployment. We would like to create users in a connection, so we need to add the client ‘id’ (not the ‘client_id’) in auth0_connection.enabled_clients, but the ‘id’ is not visible in the application console page or elsewhere.

How do we get the client id so we can use it?

Hi @arthuston-abacus,

The property enabled_clients passed to POST/api/v2/connections refers to all of your tenant’s applications which support a connection.

A connection is the relationship between Auth0 and a source of users. For example, google-oauth2 is a social connection that allows Auth0 to obtain profile/email info from gmail users.

To create users in a connection, you can use the POST/api/v2/users endpoint and pass the connection name.

For example, this request will create a user for the connection named “Username-Password-Authentication”:

{
  "email": "john.doe@gmail.com",
  "user_metadata": {},
  "blocked": false,
  "email_verified": false,
  "app_metadata": {},
  "given_name": "John",
  "family_name": "Doe",
  "name": "John Doe",
  "nickname": "Johnny",
  "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": "abc",
  "connection": "Username-Password-Authentication",
  "password": "supersecret123!@#",
  "verify_email": false,
  "username": "johndoe"
}

Hi Stephanie,
Thank you for your help.

The property enabled_clients passed to POST/api/v2/connections refers to all of your tenant’s applications which support a connection. requires the ‘id’, not the ‘client_id’. Are these the same? If not, where do I get the ‘id’, it is not visible in the UI.

Using the client_id worked, thank you.

2 Likes

(Sorry for the delay–I had my reply saved about Client ID, but I must not have submitted it :disappointed:.)

Yes, the Client ID is what it’s expecting!

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