You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you do not have access to your user's password hashes, you can use our [guide for migrating them dynamically during login](./ep-migration-without-password-hash).
16
+
:::
17
+
18
+
SuperTokens allows you to import users with password hashes generated with `BCrypt`, `Argon2` and `Firebase SCrypt` with our import user API.
19
+
You can find the API spec [here](https://app.swaggerhub.com/apis/supertokens/CDI/2.16.0#/EmailPassword%20Recipe/userImport).
20
+
21
+
### Migrating users With Argon2 or BCrypt Password hashes
22
+
23
+
For users with `BCrypt` or `Argon2` password hashes you can use the following curl command to import your user.
24
+
25
+
```bash
26
+
curl --location --request POST '^{coreInfo.uri}/recipe/user/passwordhash/import' \
SuperTokens accepts `BCrypt` and `Argon2` hashes in standard format. When exporting password hashes from authentication providers the structure might be changed. For example, Auth0 prepends an identifier to the exported password hashes which needs to removed before importing into SuperTokens.
37
+
38
+
Sample password hashes for BCrypt and Argon2 in standard format:
The memory cost, rounds and salt separator retrived from the password hashing config are:
109
+
```json
110
+
{
111
+
mem_cost: 14,
112
+
rounds: 8,
113
+
base64_salt_separator: "Bw=="
114
+
}
115
+
```
116
+
117
+
The password hash would be the following: `$f_scrypt$9Y8ICWcqbzmI42DxV1jpyEjbrJPG8EQ6nI6oC32JYz+/dd7aEjI/R7jG9P5kYh8v9gyqFKaXMDzMg7eLCypbOA==$/cj0jC1br5o4+w==$m=14$r=8$s=Bw==`
118
+
119
+
The example password hash is in the following format `$f_scrypt$<passwordHash>$<salt>$m=<mem_cost>$r=<rounds>$s=<base64_salt_separator>`
120
+
121
+
#### Step 4: Run the following `curl` command to import the user
122
+
123
+
```bash
124
+
curl --location --request POST '^{coreInfo.uri}/recipe/user/passwordhash/import' \
To migrate a Passwordless user from your previous authentication provider to SuperTokens, you will first need to generate a code for the user and then call the consume code API.
@@ -77,3 +202,26 @@ curl --location --request PUT '^{coreInfo.uri}/recipe/user' \
77
202
"phoneNumber": "+14155552671"
78
203
}'
79
204
```
205
+
206
+
207
+
## ThirdParty Migration
208
+
209
+
To migrate users with social accounts we can simply call the SuperTokens Core's `signInUp` API with the provider Id and the user's third party userId.
210
+
211
+
For example:
212
+
213
+
If we were importing a user with Google as their provider with their third party userId being `106347997792363870000`, we can run the following curl command to import the user.
214
+
215
+
```bash
216
+
curl --location --request POST '^{coreInfo.uri}/recipe/signinup' \
0 commit comments