ユーザーのJSONスキーマ
{
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "The user's email address.",
"format": "email"
},
"email_verified": {
"type": "boolean",
"default": false,
"description": "Indicates whether the user has verified their email address."
},
"user_id": {
"type": "string",
"description": "The user's unique identifier. This will be prepended by the connection strategy."
},
"username": {
"type": "string",
"description": "The user's username."
},
"given_name": {
"type": "string",
"description": "The user's given name."
},
"family_name": {
"type": "string",
"description": "The user's family name."
},
"name": {
"type": "string",
"description": "The user's full name."
},
"nickname": {
"type": "string",
"description": "The user's nickname."
},
"picture": {
"type": "string",
"description": "URL pointing to the user's profile picture."
},
"blocked": {
"type": "boolean",
"description": "Indicates whether the user has been blocked."
},
"password_hash": {
"type": "string",
"description": "Hashed password for the user. Passwords should be hashed using bcrypt $2a$ or $2b$ and have 10 saltRounds."
},
"custom_password_hash": {
"type": "object",
"description": "A more generic way to provide the users password hash. This can be used in lieu of the password_hash field when the users password hash was created with an alternate algorithm. Note that this field and password_hash are mutually exclusive.",
"properties": {
"algorithm": {
"type": "string",
"enum": [
"argon2",
"bcrypt",
"hmac",
"ldap",
"md4",
"md5",
"sha1",
"sha256",
"sha512",
"pbkdf2",
"scrypt"
],
"description": "The algorithm that was used to hash the password."
},
"hash": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "The password hash."
},
"encoding": {
"type": "string",
"enum": [
"base64",
"hex",
"utf8"
],
"description": "The encoding of the provided hash. Note that both upper and lower case hex variants are supported, as well as url-encoded base64."
},
"digest": {
"type": "string",
"description": "The algorithm that was used to generate the HMAC hash",
"enum": [
"md4",
"md5",
"ripemd160",
"sha1",
"sha224",
"sha256",
"sha384",
"sha512",
"whirlpool"
]
},
"key": {
"type": "object",
"description": "The key that was used to generate the HMAC hash",
"required": [
"value"
],
"properties": {
"value": {
"type": "string",
"description": "The key value"
},
"encoding": {
"type": "string",
"enum": [
"base64",
"hex",
"utf8"
],
"default": "utf8",
"description": "The key encoding"
}
}
}
}
},
"salt": {
"type": "object",
"properties": {
"value": {
"type": "string",
"description": "The salt value used to generate the hash."
},
"encoding": {
"type": "string",
"enum": [
"base64",
"hex",
"utf8"
],
"default": "utf8",
"description": "The encoding of the provided salt. Note that both upper and lower case hex variants are supported, as well as url-encoded base64."
},
"position": {
"type": "string",
"enum": [
"prefix",
"suffix"
],
"default": "prefix",
"description": "The position of the salt when the hash was calculated. For example; MD5('salt' + 'password') = '67A1E09BB1F83F5007DC119C14D663AA' would have \"position\":\"prefix\"."
}
},
"required": [
"value"
]
},
"password": {
"type": "object",
"properties": {
"encoding": {
"type": "string",
"enum": [
"ascii",
"utf8",
"utf16le",
"ucs2",
"latin1",
"binary"
],
"default": "utf8",
"description": "The encoding of the password used to generate the hash. On login, the user-provided password will be transcoded from utf8 before being checked against the provided hash. For example; if your hash was generated from a ucs2 encoded string, then you would supply \"encoding\":\"ucs2\"."
}
}
},
"keylen": {
"type": "integer",
"description": "Desired key length in bytes for the scrypt hash. Must be an integer greater than zero. Required when algorithm is set to scrypt."
},
"cost": {
"type": "integer",
"default": 16384,
"description": "CPU/memory cost parameter used for the scrypt hash. Must be a power of two greater than one. Only used when algorithm is set to scrypt."
},
"blockSize": {
"type": "integer",
"default": 8,
"description": "Block size parameter used for the scrypt hash. Must be a positive integer. Only used when algorithm is set to scrypt."
},
"parallelization": {
"type": "integer",
"default": 1,
"description": "Parallelization parameter used for the scrypt hash. Must be a positive integer. Only used when algorithm is set to scrypt."
}
},
"required": [
"algorithm",
"hash"
],
"additionalProperties": false
},
"app_metadata": {
"type": "object",
"description": "Data related to the user that does affect the application's core functionality."
},
"user_metadata": {
"type": "object",
"description": "Data related to the user that does not affect the application's core functionality."
},
"mfa_factors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"totp": {
"type": "object",
"properties": {
"secret": {
"type": "string",
"pattern": "^[A-Z2-7]+$",
"description": "The OTP secret is used with authenticator apps (Google Authenticator, Microsoft Authenticator, Authy, 1Password, LastPass). It must be supplied in un-padded Base32 encoding, such as: JBTWY3DPEHPK3PNP"
}
},
"additionalProperties": false,
"required": [
"secret"
]
},
"phone": {
"type": "object",
"properties": {
"value": {
"type": "string",
"pattern": "^\\+[0-9]{1,15}$",
"description": "The phone number for SMS MFA. The phone number should include a country code and begin with +, such as: +12125550001"
}
},
"additionalProperties": false,
"required": [
"value"
]
},
"email": {
"type": "object",
"properties": {
"value": {
"type": "string",
"format": "email",
"description": "The email address for MFA"
}
},
"additionalProperties": false,
"required": [
"value"
]
}
},
"maxProperties": 1,
"additionalProperties": false
},
"minItems": 1,
"maxItems": 10
}
},
"required": [
"email"
],
"additionalProperties": false
}
ユーザーオブジェクトのプロパティ
object
upsertable
アプリケーションの中核機能やユーザーがアクセスできる内容に影響する可能性があるデータです。
app_metadata に保存されたデータはユーザーが編集できません。サポートプラン、ロール、アクセスグループなどが含まれる場合があります。メタデータの詳細については、ユーザープロファイルでのメタデータの仕組みを参照してください。表示 禁止されているプロパティ
表示 禁止されているプロパティ
app_metadata には、次のプロパティを含めることはできません。__tenant_idblockedclientIDcreated_atemail_verifiedemailglobalClientIDglobal_client_ididentitieslastIPlastLoginloginsCountmetadatamultifactor_last_modifiedmultifactorupdated_atuser_id
boolean
ユーザーがブロックされているかどうか。
string
必須
ユーザーのメールアドレス。
boolean
デフォルト:false
upsertable
ユーザーがメールアドレスを確認済みかどうかを示します。upsert によって
email が更新されても email_verified が更新されない場合、デフォルトで false に設定されます。string
upsertable
ユーザーの姓。
string
upsertable
ユーザーの名。
string
upsertable
ユーザーのフルネーム。
string
upsertable
ユーザーのニックネーム。
string
upsertable
ユーザーのプロフィール画像を指す URL。
string
ユーザーの一意の識別子です。先頭には接続の方式が付加されます。
object
upsertable
勤務先住所、自宅住所、ユーザー設定など、ユーザーがアクセスできる内容に影響しないデータです。メタデータの詳細については、ユーザープロファイルでのメタデータの仕組みを参照してください。
string
ユーザーのユーザー名。
string
ユーザーの接続に使用するハッシュ化されたパスワードです。ユーザーの作成時、Auth0 はパスワードの保護に bcrypt を使用します。ハッシュ化されたパスワードをインポートすると、ユーザーは既存のパスワードをそのまま使用でき、よりスムーズに利用できます。互換性のあるパスワードは、bcrypt
$2a$ または $2b$ を使用し、saltRounds を 10 にしてハッシュ化する必要があります。このプロパティは、ユーザーを初めてインポートするときにのみ指定でき、その後は更新できません。object
upsertable
ユーザーのパスワードハッシュを指定する、より汎用的な方法です。ユーザーのパスワードハッシュが別のアルゴリズムで作成された場合は、
password_hash フィールドの代わりにこのフィールドを使用できます。このフィールドと password_hash は相互排他的です。一括インポート時に、ユーザーが最初にインポートした custom_password_hash でログインしていない場合は、custom_password_hash を更新できます。表示 子要素
表示 子要素
string
必須
パスワードのハッシュ化に使用するアルゴリズム。Auth0 では、次の algorithms がサポートされています。
- Argon2
- bcrypt
- HMAC
- LDAP
- MD と SHA
- PBKDF2
- scrypt
algorithm が argon2 に設定されている場合:hash.encodingはutf8でなければなりません。hash.saltは使用できません。hash.valueは、GitHub の P-H-C / phc-string-format で指定されている PHC string format に従う必要があります。また、GitHub の Auth0 / magic で指定されている要件にも準拠する必要があります。hash.valueには、base64 エンコードされた salt (PHCドキュメントで指定) が含まれている必要があります。
algorithm が bcrypt に設定されている場合:-
hash.encodingはutf8である必要があります。 -
hash.saltは、salt のエンコーディングおよび位置と併用できます。 -
hash.valueには、次のいずれかの接頭辞が含まれている必要があります。$2a$$2b$$2y$
$2$、$sha1$、$2x$など、その他の接頭辞はサポートされていません。
hello から生成されたものです:$2b$10$nFguVi9LsCAcvTZFKQlRKeLVydo8ETv483lkNsSFI/Wl1Rz1Ypo1Kbcrypt アルゴリズムは、パスワードハッシュの計算または比較時に最大 72 バイトの入力を処理します。salt.value の長さも、この 72 バイトの入力上限に含まれます。72 バイトの上限を超える入力は切り捨てられます。たとえば、salt が 10 バイトを使用する場合、ハッシュ化または比較に使用できるパスワードの最大長は 62 バイトです。この上限を超える長さのパスワードは切り捨てられるため、パスワード強度が低下したり、ハッシュ衝突が発生したりする可能性があります。ハッシュ化する前に、必ずパスワードの長さを検証してください。algorithm が hmac に設定されている場合:hash.encodingはhexまたはbase64である必要があります。hash.digestは必須で、次のいずれかである必要があります:md4md5ripemd160sha1sha224sha256sha384sha512whirlpool
hash.key.valueは必須です。hash.key.encodingはbase64、hex、またはutf8のいずれかである必要があります。
algorithm が ldap (RFC-2307 "userPassword") に設定されている場合:hash.encodingはutf8である必要があります。hash.saltは使用できません。hash.valueは、IETF Datatracker の RFC-2307 section-5.3 で規定されている形式に従う必要があります。- スキームは
md5|smd5|sha*|ssha*のいずれかである必要があります。詳細はこちらを参照してください。 crypt スキームは、システムや実装に依存する動作のため、サポート対象外です。詳細については、Open LDAP Admin Guide - 14.4.2. CRYPT password storage schemeを参照してください。
algorithm が md4、md5、sha1、sha256、または sha512 に設定されている場合:hash.encodingにはhexまたはbase64を指定する必要があります。
algorithm が pbkdf2 に設定されている場合:hash.encodingはutf8である必要があります。hash.saltは使用できません。hash.valueは、GitHub の P-H-C / phc-string-format で規定されている PHC string format にする必要があります。hash.valueには、B64 エンコードされた salt (PHCドキュメントで規定されている、パディング文字=を省略した base64) を含める必要があります。hash.valueにはi(反復回数) およびl(keylen) パラメータを含める必要があります。これらのパラメータを省略した場合、デフォルトでi=100000およびl=64が使用されます。idはpbkdf2-<digest>形式 (pbkdf2-sha512、pbkdf2-md5など) である必要があります。サポート対象のダイジェストは次のとおりです。RSA-MD4RSA-MD5RSA-MDC2RSA-RIPEMD160RSA-SHA1RSA-SHA1-2RSA-SHA224RSA-SHA256RSA-SHA384RSA-SHA512md4md4WithRSAEncryptionmd5md5WithRSAEncryptionmdc2mdc2WithRSAripemdripemd160ripemd160WithRSArmd160sha1sha1WithRSAEncryptionsha224sha224WithRSAEncryptionsha256sha256WithRSAEncryptionsha384sha384WithRSAEncryptionsha512sha512WithRSAEncryptionssl3-md5ssl3-sha1whirlpool
algorithm が scrypt に設定されている場合:hash.encodingはhexまたはbase64のいずれかである必要があります。
integer
必須
scrypt ハッシュに使用するキーの長さ (バイト単位) 。ゼロより大きい整数である必要があります。
integer
デフォルト:16384
scrypt ハッシュに使用する CPU/メモリコストのパラメータ。1 より大きい 2 のべき乗である必要があります。
integer
デフォルト:8
scrypt ハッシュに使用するブロックサイズのパラメータ。正の整数である必要があります。
integer
デフォルト:1
scrypt ハッシュに使用する並列化パラメータ。正の整数である必要があります。
object
必須
表示 children
表示 children
string
パスワードハッシュ。
string
指定したハッシュのエンコーディング。次のいずれかを指定する必要があります:
base64hexutf8
string
HMACハッシュの生成に使用するアルゴリズム。次のいずれかを指定する必要があります:
md4md5ripemd160sha1sha224sha256sha384sha512whirlpool
object
array
このユーザーの認証に使用できる多要素認証 (MFA) です。登録をインポートすると、ユーザーはインポート後にMFAへ再登録する必要がありません。サポート対象の登録認証要素は、メール、SMS、TOTPです。
ユーザーデータのJSON例
基本的な例
基本的な例
次の内容を含むファイルは有効です。
[
{
"email": "john.doe@example.com",
"email_verified": false,
"app_metadata": {
"roles": ["admin"],
"plan": "premium"
},
"user_metadata": {
"theme": "light"
}
}
]
カスタムパスワードハッシュの例
カスタムパスワードハッシュの例
ハッシュを含むユーザーの例:
[
{
"email": "antoinette@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "md4",
"hash": {
"value": "AbuUujgF0pPPkJPSFRTpmA==",
"encoding": "base64"
}
}
},
{
"email": "mary@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "sha256",
"hash": {
"value": "d24e794fce503c3ddb1cd1ba1dd5d9b250cf9917336a0316fefd87fecf79200f",
"encoding": "hex"
},
"salt": {
"value": "abc123",
"position": "prefix"
}
}
},
{
"email": "velma@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "bcrypt",
"hash": {
"value": "$2b$10$C9hB01.YxRSTcn/ZOOo4j.TW7xCKKFKBSF.C7E0xiUwumqIDqWUXG"
}
}
},
{
"email": "edward@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "argon2",
"hash": {
"value": "$argon2id$v=19$m=65536,t=2,p=1$J6Q/82PCyaNpYKRELJyTZg$m04qUAB8rexWDR4+/0f+SFB+4XMFxt7YAvAq2UycYos"
}
}
},
{
"email": "terrell@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "pbkdf2",
"hash": {
"value": "$pbkdf2-md4$i=100000,l=64$+N375B8q0Fw$fp2R9KAM4hK/votGHC5Fu+jhqbxUD8+Nic/EMSGvNC3UP/k7wSHI0uXluHRSkZfl/BOheYqNOemayG90ZaSSQw",
"encoding": "utf8"
}
}
},
{
"email": "cecil@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "pbkdf2",
"hash": {
"value": "$pbkdf2-sha512$i=100000,l=64$KNyFsA2rWoE$I2CQGI9H0JxdDf3kERRI97kPCGxh0KWBIV3MxyaS191gDGfzVBGyS4BibhgqWQ0/ails8mHuU9ckASxHOOq58w"
}
}
},
{
"email": "sean@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "ldap",
"hash": {
"value": "{SSHA384}/cgEjdoZh85DhurDeOQEMO1rMlAur93SVPbYe5XSD4lF7nNuvrBju5hUeg9A6agRemgSXGl5YuE=",
"encoding": "utf8"
}
}
},
{
"email": "peter@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "hmac",
"hash": {
"value": "cg7f42jH39/2EaAU4wNd4s2lKIk=",
"encoding": "base64",
"digest": "sha1",
"key": {
"value": "736868",
"encoding": "hex"
}
}
}
},
{
"email": "carmella@example.com",
"email_verified": false,
"custom_password_hash": {
"algorithm": "scrypt",
"hash": {
"value": "097f6197e1b41538f723e32aa7a68e8d76227d8e432ce5faa4882a913032db29",
"encoding": "hex"
},
"salt": {
"value": "abc123",
"encoding": "utf8"
},
"keylen": 32,
"cost": 4096
}
}
]
MFA 認証要素の例
MFA 認証要素の例
MFA 要素を持つユーザーの例:
[
{
"email": "antoinette@example.com",
"mfa_factors": [
{
"totp": {
"secret": "2PRXZWZAYYDAWCD"
}
},
{
"phone": {
"value": "+15551112233"
}
},
{
"email": {
"value": "antoinette@example.org"
}
}
]
},
{
"email": "mary@example.com",
"mfa_factors": [
{
"totp": {
"secret": "JBTWY3DPEHPK3PNP"
}
}
]
},
{
"email": "velma@example.com",
"mfa_factors": [
{
"phone": {
"value": "+15551234567"
}
},
]
},
{
"email": "edward@example.com",
"mfa_factors": [
{
"email": {
"value": "edward@example.org"
}
}
]
}
]