Skip to content

ids assign

Writes a copy of a CMF users file in which every user has an ID for --target under target_ids, as the mapping’s ids.target strategy decides: a prefix, a template, a UUIDv5, or a handler’s answer (see id.target). A user that already has one keeps it.

The IDs are assigned once, into the file, so every import of it, a resumed one included, sends the same IDs, and diff and the Auth0 organizations/roles phase address the same users. A job with a --source does this itself during its export; use ids assign for a users file that didn’t come from one. validate --mapping reports the users of a file ids.target hasn’t been applied to.

Only targets that accept a chosen user ID can be given one: auth0 (the user_id, behind its auth0| prefix) and firebase (the uid). Ory Kratos, Keycloak and Cognito generate their own; their import records the IDs they gave under the report’s target_ids.

Terminal window
cat > mapping.yaml <<'EOF'
target: auth0
ids:
target: {strategy: uuidv5, namespace: 6ba7b811-9dad-11d1-80b4-00c04fd430c8}
EOF
iamigrate ids assign --in users.cmf.jsonl.gz --out users.ids.cmf.jsonl.gz --mapping mapping.yaml --target auth0
iamigrate validate --in users.ids.cmf.jsonl.gz --target auth0 --mapping mapping.yaml
FlagDescription
--inCMF users file to read; gzip is detected automatically (required)
--outCMF users file to write, gzipped when it ends in .gz; must differ from --in (required)
--mappingmapping.yaml holding the ids.target strategy (required)
--targetTarget connector name: auth0 or firebase (required)
--hookshooks.yaml declaring the handler an ids.target hands the decision to