User Migration From Drupal to Auth0

Hi Team,

We have been trying to import users from Drupal to Auth0 using the User Import API. Tried creating a test user with cURL request via Postman but we repeatedly face an issue. Our goal is to migrate user details including the hashed passwords stored in Drupal CMS to Auth0. In Drupal, the password is hashed with SHA512 mechanism. We don’t want the users to reset the password again after migration, so we are trying to save the same password in Auth0. Here is the sample cURL request and response.

cURL Request:

curl --location --request
POST ‘https://path/api/v2/jobs/users-imports
–header ‘Authorization: Bearer eyJhbGciOiJSUzI…JmVzIw’
–header ‘Cookie: did=s%3Av0%3A6f2d13e0-e3d0-11eb-88eb-3b273100ccc7.UfslPWUSjQWC5z%2B2PYUEYaBjAXU3HXL45LOBweqr1GY; did_compat=s%3Av0%3A6f2d13e0-e3d0-11eb-88eb-3b273100ccc7.UfslPWUSjQWC5z%2B2PYUEYaBjAXU3HXL45LOBweqr1GY’
–form ‘connection_id=“con_ma…aL”’
–form ‘users=@“/home/xxxxxx/Desktop/user.json”’

Response:

{
“type”: “users_import”,
“status”: “pending”,
“connection_id”: “con_ma…aL”,
“connection”: “Username-Password-Authentication”,
“created_at”: “2021-07-13T14:26:15.988Z”,
“id”: “job_TyyQI5DBJbmJTCMm”
}

When tried to find the error with specific Job ID via /api/v2/jobs/{id}/errors, we always receive 204 response (The job was retrieved, but no errors were found.)

Here is the 2 sample users json, one with basic details and another with custom password.

Sample 1
[
{
“email”: “deepika.karan@abc.com”,
“email_verified”: true,
“name”: “deepika.karan@abc.com”,
“nickname”: “deepika”,
},
{
“email”: “deepika.karan@abc123.com”,
“email_verified”: true,
“name”: “deepika.karan@abc123.com”,
“nickname”: “deepika123”,
}
]

Sample 2
[
{
“email”: “deepika.karan@abc.com”,
“email_verified”: true,
“name”: “deepika.karan@abc.com”,
“nickname”: “deepika”,

"custom_password_hash": {
    "algorithm": "sha512",
    "hash": {
        "value": "$S$Ezk76KdP8NaIvYY.SCcA9/mZwtx2bLy3RGlojBgMADekuDUTISpK",
        "encoding": "base64",
    },
    "salt": {
      "value": "a5rFCwO6jR8M1B5xKg",
      "encoding": "base64",
      "position": "prefix"
    }
},
"additionalProperties": false

},
]

Kindly help on the issue. Thanks in advance!

Hi @sudhakar.dhanapalan,

Are you not able to log in with your imported users?

The users are not migrated that is the issue. As you can see the response of user import, status is pending for some reason.

And the job never leaves the pending state? How long has the job been pending?

Forever. I checked the user management page too. The users are not created. Is something wrong with the User json that I have provided?

How many users are you submitting?

On the sample user json, there is only 2 users I am trying to import to Auth0.