Anyone here work with Auth0? I’m building my first...
# _general
j
Anyone here work with Auth0? I’m building my first Auth0-fronted app and running into issues with the JSON syntax for bulk user imports; specifically around password handling. Would love to compare notes if you’ve done this before.
Figured it out... here's what I needed..
Copy code
{
  "email": "<mailto:jonbucud@mydomain.com|jonbucud@mydomain.com>",
  "email_verified": true,
  "blocked": false,
  "custom_password_hash": {
    "algorithm": "md5",
    "hash": {
      "value": "HASHgoesHERE",
      "encoding": "base64"
    },
    "password": {
      "encoding": "utf8"
    }
  }
}
I was originally doing this...
Copy code
{
  "email": "<mailto:jonbucud@mydomain.com|jonbucud@mydomain.com>",
  "email_verified": true,
  "blocked": false,
  "user_metadata": {
    "requires_password_change": false
  },
  "custom_password_hash": {
    "algorithm": "md5",
    "hash": {
      "value": "HASHgoesHERE",
      "encoding": "utf8"
    }
  }
}
I figured
custom_password_hash
replaced the whole
password
bit, so I was leaving that out. Turns out it only defines how the hash itself is stored, you still have to tell Auth0 how to read the original password before it gets hashed. Adding
"password": { "encoding": "utf8" }
basically says “hey Auth0, when you check this hash, the password started as UTF-8 text.”