Login using whatsapp

Hello, I am creating a login page where user has to input his whatsapp number. After clicking on “Sign In” how can i perform an Http request to check the number in my 3rd party app?

If the user is not registered in my 3rd party app then the login fails. If he is registered, move to the logged in page.

How can i setup a logged in page? Is it simply setting the logic to open the second page?

Thank you in advance

Hi, there’s an “Initial view” that you can use for your login page. It will be added if you enable Direct third party authentication on the Auth tab. You can use “Dismiss initial view” flow function to let the user past the initial screen and into the rest of the app.

The logic after the button would then look something like this:

out of curiosity, What third party youre using for the whatsapp authentication?

@Dimos_Vamvourellis i want to authenticate whatsapp number manually using my Airtable data.

Here is the scenario

  1. I have a list of employees in Airtable
  2. Appgyver asks for whatsapp number in login page
  3. Appgyver creates a random number in backend to send to the whatsapp number via WhatsApp API
  4. Appgyver asks user to input the OTP
  5. If the OTP matches, the user will login

Don’t you guys think it is possible?

1 Like

yeah sure if you have managed to do it its possible, I have done the same, but instead of the whatsupp api, im using an sms api to send an OTP and then test if it matches with the OTP generated.

If youre interested, this is what i use for sms

Can you point to the documentation (what you use) to send message to whatsupp?

Where can i access the so called “initial view”?


I am using this solution

ohh ok thats perfect!

This is the page that gets opened after disabling the initial view

And here is the initial view but be careful because you need to enable the open page without authentication option (in any page that you want to access before disabling the initial view)

Oh and to change the initial view state there are dedicated functions (2) in the marketplace

May i know which two are " dedicated functions (2) in the marketplace"

here you go

I have pages like this

And a logic that ends up having “Dismiss Initial value” node at very end of the flow. How can i automatically navigate to Home page?

to take things from the beginning,

the page i showed you above you can find it in the red circle

next you have to search what i showed above and install the two functions
and then you will be able to find those installed functions at the orange circle.

After you install the two functions (i guess the dismiss initial view is already installed) you can go and add the logic to return to initial view anywhere for example in a button, so when you press the button, its like logging out of you account and the app will return at the sign in page.

lastly its just a matter of setting up what page you want to be the initial view and what page you want to open after dismiss initial view.
this one can be done as i showed in the fist answer.

I did this. Thanks!

But as soon as the user leave the app, when he re-enters it, he has to login again. How can i have a login session for example 8 hour window? Logging in too much is annoying

you can use something like this in the page layout of your authentication page
where, if there is a refresh token saved (you have to save it to local storage when signing in and if the user chooses to stay signed in)

and with the refresh token you send it to firebase and if it comes back as real you let it sign in automatically.

for the get id token
url: “https://securetoken.googleapis.com/v1/token?key=” + appVars.apikey
Post method
and the parameter: {grant_type: ‘refresh_token’, refresh_token: outputs[“Get item from storage”].item }

Then, based on the user id that you get in the response you can get the user profile record for example.

Its important to note that if the user signs out you need to delete the refresh token so the next time it doesnt automatically sign in to his account.

more here:

is it mandatory to use firebase to the token? I am not doing any login with firebase

oh if you dont want to use firebase for authentication, there is a way of connecting other third party authentication but i dont know how you can look in the forum.

@Kenny_Purnomo as I mentioned in my post, you can enable “Direct third party authentication” to just get the views and no Firebase related logic:

You can implement persistent login by using for example the “Set item to storage” flow with a timestamp for the previous login. Then you can check for the value in Global canvas page at “App launched” event, and if it’s less than 8 days ago dismiss initial view, if not, do nothing

1 Like

A general question, if you dont need to authenticate somehow the user, why would you need to enable the authentication, meaning that in that case, you dont make a profile for the user (ex to track his activity ) so whats the practical reason?
Also do you know any site that works that way so i can understand better?

i guess thats one reason

but can you explain more about this and are there any other benefits?

The third party authentication is for cases where you’re authenticating via some other service than Firebase, so you’d just want the initial view to be installed, and then you would use the data configurator + data flow functions to connect to your backend that handles the registration/login process.

1 Like