Skip to content
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

feat: Add bulk import docs #790

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 12 additions & 27 deletions v2/emailpassword/migration/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,27 @@ hide_title: true

# About

In this guide we will be going through the process of migrating users from an external Authentication provider to SuperTokens.
This guide explains how to migrate users from an external authentication providers like `Auth0` to SuperTokens.

There are 3 steps to user migration:
Migration involves two main steps:

- Account Migration
- User Creation
- UserId Mapping
- Mark email as verified
- User Data Migration
- Session Migration

## Step 1) Account Migration:

### User Creation
- Our first step involves creating a SuperTokens user by importing their account credentials from the previous authentication provider.
- You can learn more about how to implement these changes in the [User Creation](./account-creation/user-creation) section.
In the first step, use the Bulk User Import API to create a SuperTokens user for each user in your existing authentication provider. This API allows you to:

### User ID Mapping
- If you have stored information against existing userIds in your application table, you can use UserId Mapping to map the existing userId to the user's SuperTokens userId.
- Once the userIds are mapped you can use the existing userId to interact with all of SuperTokens APIs.
- You can learn more about how to implement these changes in the [User Id Mapping](./account-creation/user-id-mapping) section.
- Create a SuperTokens user.
- Map the existing userId to the SuperTokens userId.
- Mark the email as verified (if applicable).
- Add roles, metadata, and MFA devices (if applicable).
- Link multiple login methods for the same user (if applicable).

### Mark email as verified
- Once a SuperTokens user has been created and their userId has been mapped, you need to mark their email as verified (if applicable) so that they do not have to go through the email verification process again.
- You can learn more about how to implement these changes in [this section](./account-creation/email-verification).
For implementation details, refer to the [Bulk User Import](./bulk-user-import) section.

## Step 2) User Data Migration
- Now that your user's account has been migrated over to SuperTokens we can associate additional information like roles and metadata with your user.
- You can learn more about how to implement these changes in the [User Data Migration](./data-migration) section.
## Step 2) Session Migration

## Step 3) Session Migration
If users have active sessions, use [this guide](./session-migration) to migrate their external provider sessions to SuperTokens sessions. This way, users won't need to re-authenticate.

- If you have users with an existing session, you can use [this guide](./session-migration) to migrate their external provider sessions to a SuperTokens session.
- This will prevent users from having to re-authenticate.

You can learn more about how to implement these changes in the [Session Migration](./session-migration) section.

## Step 4) MFA migration
If you are using MFA in your app, checkout the MFA migration section [here](/docs/mfa/migration) after you have gone through the above migration steps.
Learn how to implement session migration in the [Session Migration](./session-migration) section.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';
# User Creation without password hashes

<!-- COPY SECTION -->
<!-- ./thirdpartyemailpassword/migration/account-creation/ep-migration-without-password-hash.mdx -->
<!-- ./thirdpartyemailpassword/migration/ep-migration-without-password-hash.mdx -->
<!-- 1 -->

:::caution
Expand Down Expand Up @@ -758,7 +758,7 @@ func generatePassword() string {
</BackendSDKTabs>

<!-- COPY SECTION -->
<!-- ./thirdpartyemailpassword/migration/account-creation/ep-migration-without-password-hash.mdx -->
<!-- ./thirdpartyemailpassword/migration/ep-migration-without-password-hash.mdx -->
<!-- 2 -->

The code above overrides the `generatePasswordResetTokenPOST` API. This is the first step in the password reset flow and is responsible for generating the password reset token to be sent with the reset password email.
Expand Down Expand Up @@ -1299,7 +1299,7 @@ func validateAndGetUserInfoFromExternalProvider(email string, password string) *
The code above adds the following changes to the `signIn` function:

<!-- COPY SECTION -->
<!-- ./thirdpartyemailpassword/migration/account-creation/ep-migration-without-password-hash.mdx -->
<!-- ./thirdpartyemailpassword/migration/ep-migration-without-password-hash.mdx -->
<!-- 4 -->

- Adds an additional check where if a user exists in SuperTokens, we check if they have the `isUsingTemporaryPassword` flag set in their metadata.
Expand Down
2 changes: 1 addition & 1 deletion v2/emailpassword/migration/session-migration.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: session-migration
title: Step 3) Session Migration
title: Session Migration
hide_title: true
---

Expand Down
39 changes: 12 additions & 27 deletions v2/passwordless/migration/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,27 @@ hide_title: true

# About

In this guide we will be going through the process of migrating users from an external Authentication provider to SuperTokens.
This guide explains how to migrate users from an external authentication providers like `Auth0` to SuperTokens.

There are 3 steps to user migration:
Migration involves two main steps:

- Account Migration
- User Creation
- UserId Mapping
- Mark email as verified
- User Data Migration
- Session Migration

## Step 1) Account Migration:

### User Creation
- Our first step involves creating a SuperTokens user by importing their account credentials from the previous authentication provider.
- You can learn more about how to implement these changes in the [User Creation](./account-creation/user-creation) section.
In the first step, use the Bulk User Import API to create a SuperTokens user for each user in your existing authentication provider. This API allows you to:

### User ID Mapping
- If you have stored information against existing userIds in your application table, you can use UserId Mapping to map the existing userId to the user's SuperTokens userId.
- Once the userIds are mapped you can use the existing userId to interact with all of SuperTokens APIs.
- You can learn more about how to implement these changes in the [User Id Mapping](./account-creation/user-id-mapping) section.
- Create a SuperTokens user.
- Map the existing userId to the SuperTokens userId.
- Mark the email as verified (if applicable).
- Add roles, metadata, and MFA devices (if applicable).
- Link multiple login methods for the same user (if applicable).

### Mark email as verified
- Once a SuperTokens user has been created and their userId has been mapped, you need to mark their email as verified (if applicable) so that they do not have to go through the email verification process again.
- You can learn more about how to implement these changes in [this section](./account-creation/email-verification).
For implementation details, refer to the [Bulk User Import](./bulk-user-import) section.

## Step 2) User Data Migration
- Now that your user's account has been migrated over to SuperTokens we can associate additional information like roles and metadata with your user.
- You can learn more about how to implement these changes in the [User Data Migration](./data-migration) section.
## Step 2) Session Migration

## Step 3) Session Migration
If users have active sessions, use [this guide](./session-migration) to migrate their external provider sessions to SuperTokens sessions. This way, users won't need to re-authenticate.

- If you have users with an existing session, you can use [this guide](./session-migration) to migrate their external provider sessions to a SuperTokens session.
- This will prevent users from having to re-authenticate.

You can learn more about how to implement these changes in the [Session Migration](./session-migration) section.

## Step 4) MFA migration
If you are using MFA in your app, checkout the MFA migration section [here](/docs/mfa/migration) after you have gone through the above migration steps.
Learn how to implement session migration in the [Session Migration](./session-migration) section.
39 changes: 12 additions & 27 deletions v2/thirdparty/migration/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,27 @@ hide_title: true

# About

In this guide we will be going through the process of migrating users from an external Authentication provider to SuperTokens.
This guide explains how to migrate users from an external authentication providers like `Auth0` to SuperTokens.

There are 3 steps to user migration:
Migration involves two main steps:

- Account Migration
- User Creation
- UserId Mapping
- Mark email as verified
- User Data Migration
- Session Migration

## Step 1) Account Migration:

### User Creation
- Our first step involves creating a SuperTokens user by importing their account credentials from the previous authentication provider.
- You can learn more about how to implement these changes in the [User Creation](./account-creation/user-creation) section.
In the first step, use the Bulk User Import API to create a SuperTokens user for each user in your existing authentication provider. This API allows you to:

### User ID Mapping
- If you have stored information against existing userIds in your application table, you can use UserId Mapping to map the existing userId to the user's SuperTokens userId.
- Once the userIds are mapped you can use the existing userId to interact with all of SuperTokens APIs.
- You can learn more about how to implement these changes in the [User Id Mapping](./account-creation/user-id-mapping) section.
- Create a SuperTokens user.
- Map the existing userId to the SuperTokens userId.
- Mark the email as verified (if applicable).
- Add roles, metadata, and MFA devices (if applicable).
- Link multiple login methods for the same user (if applicable).

### Mark email as verified
- Once a SuperTokens user has been created and their userId has been mapped, you need to mark their email as verified (if applicable) so that they do not have to go through the email verification process again.
- You can learn more about how to implement these changes in [this section](./account-creation/email-verification).
For implementation details, refer to the [Bulk User Import](./bulk-user-import) section.

## Step 2) User Data Migration
- Now that your user's account has been migrated over to SuperTokens we can associate additional information like roles and metadata with your user.
- You can learn more about how to implement these changes in the [User Data Migration](./data-migration) section.
## Step 2) Session Migration

## Step 3) Session Migration
If users have active sessions, use [this guide](./session-migration) to migrate their external provider sessions to SuperTokens sessions. This way, users won't need to re-authenticate.

- If you have users with an existing session, you can use [this guide](./session-migration) to migrate their external provider sessions to a SuperTokens session.
- This will prevent users from having to re-authenticate.

You can learn more about how to implement these changes in the [Session Migration](./session-migration) section.

## Step 4) MFA migration
If you are using MFA in your app, checkout the MFA migration section [here](/docs/mfa/migration) after you have gone through the above migration steps.
Learn how to implement session migration in the [Session Migration](./session-migration) section.
39 changes: 12 additions & 27 deletions v2/thirdpartyemailpassword/migration/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,27 @@ hide_title: true

# About

In this guide we will be going through the process of migrating users from an external Authentication provider to SuperTokens.
This guide explains how to migrate users from an external authentication providers like `Auth0` to SuperTokens.

There are 3 steps to user migration:
Migration involves two main steps:

- Account Migration
- User Creation
- UserId Mapping
- Mark email as verified
- User Data Migration
- Session Migration

## Step 1) Account Migration:

### User Creation
- Our first step involves creating a SuperTokens user by importing their account credentials from the previous authentication provider.
- You can learn more about how to implement these changes in the [User Creation](./account-creation/user-creation) section.
In the first step, use the Bulk User Import API to create a SuperTokens user for each user in your existing authentication provider. This API allows you to:

### User ID Mapping
- If you have stored information against existing userIds in your application table, you can use UserId Mapping to map the existing userId to the user's SuperTokens userId.
- Once the userIds are mapped you can use the existing userId to interact with all of SuperTokens APIs.
- You can learn more about how to implement these changes in the [User Id Mapping](./account-creation/user-id-mapping) section.
- Create a SuperTokens user.
- Map the existing userId to the SuperTokens userId.
- Mark the email as verified (if applicable).
- Add roles, metadata, and MFA devices (if applicable).
- Link multiple login methods for the same user (if applicable).

### Mark email as verified
- Once a SuperTokens user has been created and their userId has been mapped, you need to mark their email as verified (if applicable) so that they do not have to go through the email verification process again.
- You can learn more about how to implement these changes in [this section](./account-creation/email-verification).
For implementation details, refer to the [Bulk User Import](./bulk-user-import) section.

## Step 2) User Data Migration
- Now that your user's account has been migrated over to SuperTokens we can associate additional information like roles and metadata with your user.
- You can learn more about how to implement these changes in the [User Data Migration](./data-migration) section.
## Step 2) Session Migration

## Step 3) Session Migration
If users have active sessions, use [this guide](./session-migration) to migrate their external provider sessions to SuperTokens sessions. This way, users won't need to re-authenticate.

- If you have users with an existing session, you can use [this guide](./session-migration) to migrate their external provider sessions to a SuperTokens session.
- This will prevent users from having to re-authenticate.

You can learn more about how to implement these changes in the [Session Migration](./session-migration) section.

## Step 4) MFA migration
If you are using MFA in your app, checkout the MFA migration section [here](/docs/mfa/migration) after you have gone through the above migration steps.
Learn how to implement session migration in the [Session Migration](./session-migration) section.
Loading