https://supertokens.com/ logo
Migration of users
t

TeK

04/03/2023, 2:16 PM
Also is it possible to tweak the settings of the EmailPassword thingy ? like to change hashing algorithm and to directly supply a hash to the
ThirdPartyEmailPassword.emailPasswordSignIn()
?
r

rp

04/03/2023, 2:25 PM
hey @TeK it is possible to directly supply the hash. See our migration docs: https://supertokens.com/docs/thirdpartyemailpassword/migration/account-creation/user-creation You essentially want to call the API for migration like this:
curl --location --request POST 'http://localhost:3567/recipe/user/passwordhash/import' \
--header 'api-key: <API_KEY(if configured)>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "johndoe@example.com",
    "passwordHash": "$argon2d$v=19$m=12,t=3,p=1$NWd0eGp4ZW91b3IwMDAwMA$57jcfXF19MyiUXSjkVBpEQ"
}'
t

TeK

04/03/2023, 2:26 PM
Ah there's no methods for it in the backend ?
r

rp

04/03/2023, 2:26 PM
not for this operation.
t

TeK

04/03/2023, 2:27 PM
Uhm, i guess i'll send the password in clear then to my API, and how can i get the google auth url from the backend is it possible ?
r

rp

04/03/2023, 2:28 PM
> how can i get the google auth url from the backend is it possible ? Im not sure what you mean here.
t

TeK

04/03/2023, 2:28 PM
I'm doing something like that basically. So i call this route from my Unity client to either login with email/password or get a google auth url and then after that it'll redirect to another endpoint for completing google login

https://cdn.discordapp.com/attachments/1092452491133734943/1092455654351966259/image.png

I'm not sure if its the proper way, but my end-goal is to be able to login with email & socials from Unity and get the session token. So then i can make requests to my api without relogging in as the client sends the token
Not sure if its the recommended way but, i feel like its a good starting point
r

rp

04/03/2023, 2:30 PM
you can see the API exposed by the backend SDK here and query them directly if you want: https://supertokens.io/docs/fdi
t

TeK

04/03/2023, 2:34 PM
May i ask from where are those api endpoints in the sourcecode ?
auth/authorisationurl?thirdPartyId=google
do exactly what i want so i'd like to see how is it built
t

TeK

04/03/2023, 2:37 PM
Thanks a lot, just as a last question, i'm sorry to annoy you. Is there a way to get the client session token after using the
ThirdPartyEmailPassword.emailPasswordSignIn
method ? this way i can return it to clients so they can use it next time for other requests ?
r

rp

04/03/2023, 2:40 PM
Can you ask this on a other thread? It’s not related to this thread’s topic