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!