Hi, During migration I am trying to create users u...
# ask-a-descoper
s
Hi, During migration I am trying to create users using createBatch API and in the object I am passing all the relevant details for Argon2 password (hash, salt, iterations, memory and threads) but still I am not able to login as a user using the migrated password in Descope.
a
Hey @Shivam Garg let me check this
s
thanks Atharva, let me know if more details are required. Please consider this a high priority item, as our descope migration heavily depends on this.
a
surely
@Shivam Garg which platform are you migrating from?
s
we are migrating from our database, no platform as such
a
alright alright what exactly is the error your getting during login?
s
Copy code
[E062903]: Password signin failed

Wrong password or unknown user -
a
The hash and salt you have provided in the payload are in a bit array map you need a base64 string please follow this doc https://docs.descope.com/migrate/custom#2-argon2 https://docs.descope.com/password-hashing
s
Copy code
package com.descope.model.user.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BatchUserPasswordArgon2 {
  byte[] hash; // the hash in raw bytes (base64 strings should be decoded first)
  byte[] salt; // the salt in raw bytes (base64 strings should be decoded first)
  int iterations; // the memory cost value (usually between 1 to 10)
  int memory; // the memory cost value in kilobytes (usually between 1,000 to 1,000,000)
  int threads; // the threads cost value (usually between 1 to 10)
}
I am using descope java-sdk:1.0.58 and byte[] is the one that is required in that sdk
a
let me check this
Hey @Shivam Garg are you using
argon2i
for you current auth implementation ?
s
yes, we are using argon2i
👍 1
can you provide an ETA for update and reference to the request ticket if created ?
a
I have passed on the message internally I'll update you ASAP You can create a ticket from the help section in your console.
Looping in @Gil Shapira here
s
created the ticket
a
Thanks 👍
Hey @Shivam Garg Can you provide one or two example pairs of
(password cleartext, hashed password)
so we can validate?
s
shared with you @Atharva Joshi
a
Thanks I'll pass this on internally
s
is there any other way to make this migration work, please suggest as we are short on time.
a
Reuven suggested a workaround - we can do a JIT migration where you can have the users created without password in Descope. then when the user tries to log in: Option A prompt them with a reset password form and update the password to be stored in Descope Option B have an HTTP connector send a request with the user's password to your backend/lambda to check wether the user has entered the right password. if so, we can have a simple, one time code sent to verify his email and then save the password in Descope. here is a flow example, for the same with migrating from cognito + using AWS lambdas.
sign-up-or-in-cognito-migration (2).json
s
@Uday Singh
u
@Atharva Joshi I tried to share the password in the payload using the HTTP connector. The body looks like this, but the password field is coming as null.
Copy code
{
  "email": "{{form.externalId}}",
  "password": "{{form.password}}"
}
https://authtown.slack.com/archives/C07P7AN1EQH/p1765266532354119
a
let me check
yes form.password is not exposed to the flow let me check for a workaround
@Uday Singh you need to use the new password field and use the form.newPassword key in the reset password screen this context key will be used in the HTTP connector and you can follow the rest of the process
Hey @Uday Singh I found an article that might help for the second point we discussed https://docs.descope.com/flows/actions/multiple-login-id#link-user-identities-across-different-auth-methods
Following this, you should get a user that looks like this Notice their email id and phone number are added as login ids
s
Hi @Atharva Joshi, wanted to check if the support for Argon2i while migration has been released ?
a
Hey @Shivam Garg yes support for Argon2i has been added on our side I'll update you about the release ASAP
✅ 1
s
hey @Atharva Joshi any update?
a
Hey @Shivam Garg, Gil says the feature is deployed to production. If youre using the API to import users, you need to add
"type": "argon2i"
field to the JSON
s
thanks
a
feel free to reach out if you have any more problems 🙌
s
can you please share the link to the release note
a
i dont think there is a release note as this change was not made in the sdk the change was made to the descope backend API itself But looping in @Gil Shapira for more info