Back

how create email session from the BE side

  • 0
  • Self Hosted
  • Accounts
yasmeen
18 Sep, 2023, 17:25

how can i create an email session use this session to get the providerAccessToken from the BE side, this what i have however the const client = new Client() .setEndpoint(this.baseUrl) .setProject(this.projectId); const account = new Account(client2); const appwriteSession = await account.createEmailSession( user.email, pass, ); however the providerAccessToken is empty

TL;DR
The user is asking how to create an email session from the backend side. They have provided some helpful documentation links. It is mentioned that authentication typically happens on the client side and server side SDKs are used for admin-related tasks. The user is confused about getting a session only through email and password from the server side. It is stated that creating a session with email is only available on the client side. The user wants to create an email session and get a providerAccessToken from the backend side, but the providerAccessToken is empty. Solution: Creating a session with email is only possible on the client side. Therefore, it is not possible
Drake
18 Sep, 2023, 17:27

That's only available for oauth sessions.

What exactly are you trying to accomplish?

Drake
18 Sep, 2023, 17:27

Impersonate the user?

yasmeen
18 Sep, 2023, 17:28

i am crating the signIn method, and i want to get an access_token

safwan
18 Sep, 2023, 17:29

Creating a session with email is available only on the client-side.

yasmeen
18 Sep, 2023, 17:31

ohh i see so if the sigin is only through email and password i can't get a session right from the server side?

Drake
18 Sep, 2023, 17:32

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.

Drake
18 Sep, 2023, 17:33

typically, authentication happens client side and server side SDKs are meant for admin related things. see https://appwrite.io/docs/sdks

yasmeen
18 Sep, 2023, 17:34

ok thank will use that, this my first time using discord i see ok thank you

Drake
18 Sep, 2023, 17:34

no worries!

Drake
18 Sep, 2023, 17:34
yasmeen
18 Sep, 2023, 17:35

thanks

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more