Back

[Solved] Custom Phone Authentication

  • 1
  • Accounts
erikkamalov
15 Dec, 2023, 15:21

And he has super role to all actions.

TL;DR
The user had a question about custom phone authentication in Appwrite. They were trying to get the cookie value for the session of a member in their organization. They found a solution and thanked the person who helped them. There is no specific solution mentioned in the thread.
ideclon
15 Dec, 2023, 15:26

Just checking - you mean Appwrite Console users, not Auth users, right? Yes, I know that. But still not clear on what you mean by โ€œon behalf of the adminโ€

erikkamalov
15 Dec, 2023, 15:29

Yes i mean appwrite console user๐Ÿ˜….

ideclon
15 Dec, 2023, 15:33

Still not clear on โ€œon behalf of the adminโ€?

erikkamalov
15 Dec, 2023, 15:40

I mean create a phone session with the appwrite console user, This way we get access to the secret.

Mosh Ontong
16 Dec, 2023, 01:45

Btw, @erikkamalov how much is the price offer of your SMS provider?

Mosh Ontong
16 Dec, 2023, 01:45

is that available also in worldwide? I am from Philippines, and I am looking for cheapest SMS provider

erikkamalov
16 Dec, 2023, 04:03

@Mosh Ontong 1 sms of my SMS provider 0.014$. Others have a minimum 0.04$.

erikkamalov
16 Dec, 2023, 04:04

The numbers may not seem like a big difference, but when there are a lot of users, the amount will be large.

Mosh Ontong
16 Dec, 2023, 04:09

what is the name of your provider?

ideclon
16 Dec, 2023, 21:42

Sorry, still not getting it! Unless you mean youโ€™re doing it with a Server SDK?

erikkamalov
17 Dec, 2023, 12:06
erikkamalov
17 Dec, 2023, 12:09

I don't do anything with the help of the server SDK. I use the fetch method in bun to make a post request to create a session. There is no method for creating a session on the server SDK. But you can use the client SDK or

erikkamalov
17 Dec, 2023, 12:10

You can use rest API for calling sessions/phone

ideclon
17 Dec, 2023, 15:48

Yeah, so in that case, I still donโ€™t understand what you mean by โ€œwith the appwrite console userโ€

wonderfulcheese
18 Dec, 2023, 09:12

I invited a member for the organisation. Now I have logged in to Appwrite from the new account. In the function code you shared, you have added the Cookie: 'a_session_console_legacy=session of member;', cookie header. Can you please share how exactly are you getting the value session of member? Nevermind found it

wonderfulcheese
18 Dec, 2023, 10:25

@erikkamalov I am making a request to https://add/v1/account/sessions/phone from Postman. I've set the a_session_console_legacy cookie and when I make a post request, the OTP is being sent but in the response still I'm getting the secret as empty string.

erikkamalov
18 Dec, 2023, 13:54

@wonderfulcheese pls show me your code?

wonderfulcheese
18 Dec, 2023, 14:04

I have added the cookie in Postman for my appwrite instance's domain. As you can see in the image, the secret is an empty string.

erikkamalov
18 Dec, 2023, 14:14

@wonderfulcheese Pls how request header

wonderfulcheese
18 Dec, 2023, 14:24

These are the headers @erikkamalov

erikkamalov
18 Dec, 2023, 14:26

@wonderfulcheese pls add

erikkamalov
18 Dec, 2023, 14:26

'x-appwrite-mode': 'admin',

erikkamalov
18 Dec, 2023, 14:26

This parameter

wonderfulcheese
18 Dec, 2023, 14:28

Worked! Thanks a lot @erikkamalov

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