Feature Requests
Share ideas, discuss and vote on requests from other users in community
 

Login with Facebook via API

Tay Shu Yih shared this idea 8 months ago
Under Consideration

Hi. We recently integrate social media login https://docs.whmcs.com/Configuring_Sign-In_using_Facebook

The integration is successful. Now we would like to do the same thing in our mobile apps client using WHMCS API too.

Currently we are using this API to login https://developers.whmcs.com/api-reference/validatelogin/

May I know how can I integrate the Facebook login through API as well?

Thanks.

Comments (3)

photo
1

Can you say more about how you want to use this? What is your end goal?

Part of the security of OAuth validation is the client never providers the username & password combination for Facebook to WHMCS. They send details to Facebook and Facebook returns a token which is provided to WHMCS which it uses to get additional details, confirm the linked details, and authenticate the user. If you want to pass the FB login details, that is not something the FB API is designed to do. If you want to pass a token, you'd have to be on the same exact domain and you'd end up writing a lot of code to implement your part even if we implemented an extension to the FB login that did this. Depending on the situation, it might be simpler to try different aproaches.

photo
1

Hi Nate,

We are using WHMCS API for our mobile apps currently. It's used by our client in web using WHMCS too. Currently, they can login to our apps using the same WHMCS account they created in web, then purchase a domain etc. All the call are through WHMCS API and go into the same WHMCS database.

We just recently turn on the login via facebook in WHMCS. It allows user to login via facebook to the same WHCMS account. I believe the fb token is stored in whmcs database somewhere.

Is that possible for me to do the same from mobile apps? i.e. User login via fb in whmcs website. Then later when he can logins via facebook in our apps, it will login to the same whmcs account. Probably I can do the fb integration on my apps, then pass the token / fb user id through whmcs api to whmcs? And it checks if the token/fb user id match to any existing whmcs account. If yes, return the matching user record like https://developers.whmcs.com/api-reference/validatelogin/

photo
1

Thanks for the clarification, I think you've described a chunk of work that is possible to deliver at some point in the future. I don't make the prioritization choices for the company but that is enough clarity to potentially move forward.

As an alternative approach if you store the link between the WHMCS account and the Client in your system, you could implement the FB login -> Your App and then use OpenID to login from your App -> WHMCS:

https://developers.whmcs.com/oauth/introduction/

photo