-
Notifications
You must be signed in to change notification settings - Fork 435
fix: correct Auth0 export users script and update documentation #2330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
vinckr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
looks pretty good already, I would do a test of the script and left some comments on style.
I think the numbered list here don't add anything and in general would be better without.
there are 2 steps only anyway so its not that hard to navigate and just looks confusing in the ToC (see screenshot below).
So please remove the Phase X parts and numbered list in headings.
also in line with the style guide: "Avoid using symbols and special characters in headings."
![]()
docs/migrate-to-ory/auth0.mdx
Outdated
| bash <(curl https://raw.githubusercontent.com/ory/docs/master/code-examples/migrate-to-ory/0-get-auth0-user-data.sh) | ||
| ``` | ||
|
|
||
| This script creates `AUTH0_USERDATA.json` in your current directory containing all exported user data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This script creates `AUTH0_USERDATA.json` in your current directory containing all exported user data. | |
| This script creates `AUTH0_USERDATA.json` in your current directory and contains all the exported user data. |
docs/migrate-to-ory/auth0.mdx
Outdated
| - **Auth0 account** with admin access to export user data | ||
| - **Ory account** and CLI installed | ||
| {/* TODO: change this to refer to new migration guide (docs/migrate-to-ory/migrate/create-project.mdx) */} | ||
| - **Ory project** created - See [creating a project](index.mdx) for instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should link to here for create project: docs/migrate-to-ory/migrate/create-project
docs/migrate-to-ory/auth0.mdx
Outdated
| export them as part of the general export process. To get the password hashes and other password-related information, you must | ||
| [create an Auth0 support ticket](#create-auth0-support-ticket). | ||
|
|
||
| If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they | |
| - If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they used before the migration. For more information, see [Bulk identity migration](../migrate-to-ory/migrate/migrate-strategies#bulk-identity-migration). |
docs/migrate-to-ory/auth0.mdx
Outdated
| [create an Auth0 support ticket](#create-auth0-support-ticket). | ||
|
|
||
| If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they | ||
| used before the migration. If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| used before the migration. If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate | |
| - If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate | |
| them using a [Password migration hook](../kratos/manage-identities/25_import-user-accounts-identities.mdx). For more information, see [Graceful identity migration](../migrate-to-ory/migrate/migrate-strategies#graceful-identity-migration). |
docs/migrate-to-ory/auth0.mdx
Outdated
|
|
||
| If you get your users' password hashes and import them to Ory, users can log in to their accounts using the same credentials they | ||
| used before the migration. If you can't get users' password hashes, you can still import Auth0 user accounts to Ory and migrate | ||
| them using a [Password migration hook](../kratos/manage-identities/25_import-user-accounts-identities.mdx). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| them using a [Password migration hook](../kratos/manage-identities/25_import-user-accounts-identities.mdx). |
e223ec6 to
fb8ed63
Compare
|
|
||
| ## Export password hashes | ||
| - Auth0 account with admin access to export user data | ||
| - Ory account and CLI installed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Ory account and CLI installed | |
| - Ory account with an Ory project already created - See [creating a project](docs/migrate-to-ory/migrate/create-project.mdx) for instructions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We repeat the Ory CLI tool below in the Required tools section.
| ### Create bulk user export | ||
|
|
||
| To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API | ||
| Access Token and the ID of your connection. This data is used by the migration script you run to get the user data. You can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Access Token and the ID of your connection. This data is used by the migration script you run to get the user data. You can | |
| Access Token and the ID of your connection. You will need this information to export the Auth0 user data, when you run the migration export script. |
|
|
||
| To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API | ||
| Access Token and the ID of your connection. This data is used by the migration script you run to get the user data. You can | ||
| inspect the script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| inspect the script | |
| You can inspect the export script |
|
|
||
| ### Create bulk user export | ||
|
|
||
| To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need a Management API | |
| To create a [bulk user export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports), you need the Management API |
| ## Import users to Ory | ||
|
|
||
| To import your Auth0 users to Ory, you must create new users in Ory and associate them with the imported data. | ||
| ### Configure environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Configure environment variables | |
| ### Set environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to keep it consistent with previous section
| - If you don't have password hashes from Auth0, create new users for the known email addresses and the associated data. In this | ||
| case, users must create new passwords when they log in to their accounts for the first time. To facilitate this, enable | ||
| [account recovery](../kratos/self-service/flows/account-recovery-password-reset). | ||
| Configure the migration script by exporting the necessary environment variables: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Configure the migration script by exporting the necessary environment variables: | |
| Set necessary environment variables for the import script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to keep it consistent with previous section
| 3. Go to **Authentication** and navigate to **Database**. | ||
| 4. Click the connection for which you want to export user data and copy its ID. | ||
|
|
||
| #### Run export script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #### Run export script | |
| ### Run export script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increasing the heading level to match "Run import script" later
| - Auth0 account with admin access to export user data | ||
| - Ory account and CLI installed | ||
| - Ory project created - See [creating a project](docs/migrate-to-ory/migrate/create-project.mdx) for instructions | ||
| - Required tools: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| When you export password hashes, none of the involved parties has access to users' plain text passwords. | ||
| 1. [Prepare your Auth0 data](#prepare-your-auth0-data): Export user data and password hashes | ||
| 2. [Configure your Ory project](#configure-your-ory-project): Set up identity schema for email authentication | ||
| 3. [Import users to Ory](#import-users-to-ory): Run the migration script to create users in Ory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. [Import users to Ory](#import-users-to-ory): Run the migration script to create users in Ory | |
| 3. [Import users to Ory](#import-users-to-ory): Run the migration import script to create users in Ory |
|
|
||
| #### Run export script | ||
|
|
||
| The script accounts for all possible metrics you can export in a bulk user export. The bulk user export is a compressed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The script accounts for all possible metrics you can export in a bulk user export. The bulk user export is a compressed, | |
| The export script accounts for all possible metrics you can export in a bulk user export. The bulk user export is a compressed, |
| export AUTH0_TOKEN="your_auth0_management_api_token" | ||
| ``` | ||
|
|
||
| 2. Run the script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. Run the script: | |
| 2. Run the export script: |
| bash <(curl https://raw.githubusercontent.com/ory/docs/master/code-examples/migrate-to-ory/0-get-auth0-user-data.sh) | ||
| ``` | ||
|
|
||
| This script creates `AUTH0_USERDATA.json` in your current directory and contains all the exported user data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This script creates `AUTH0_USERDATA.json` in your current directory and contains all the exported user data. | |
| This export script creates `AUTH0_USERDATA.json` in your current directory and contains all the exported user data. |
Related Issue or Design Document
Fixes the Auth0 export script and improves the migration guide documentation for better clarity.
Changes
Script Fixes (
0-get-auth0-user-data.sh)Documentation Improvements (
auth0.mdx)AUTH0_USERDATA.jsonautomatically.Impact
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.