Custom login with facebook.

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

truongps
Posts: 32
Joined: 27 Sep 2015, 17:06

Custom login with facebook.

Postby truongps » 23 May 2016, 04:46

Hi,
I use custom Facebook login. This flow:
Step 1. Client get access token from Facebook app.
Step 2. Send token to server.
Step 3. Server call Facebook API to check the token.
Step4. Server check OK. Send login OK to client.

Now, It run OK. But I want to ask about step 3. I should call Facebook API in new thread or in current login thread?

If I should call this Facebook API in new thread, how can I call send login OK to client when this thread complete?

Please, help me understand and implement this function clean and correct. Thank you!
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Custom login with facebook.

Postby Lapo » 23 May 2016, 07:46

Hi,
if you're using a recent version of SFS2X (2.9 and higher) you can safely run the code in the Extension thread.

SFS2X 2.9 and higher uses auto load balancing thread pools so it will instantiate more threads if and when necessary and remove them when not needed anymore:
http://docs2x.smartfoxserver.com/Advanc ... oadBalance

If you have lots of concurrent logins you can change these parameter in the Thread Pool config (AdminTool > Server Configurator):

Backup threads
: 64
Maximum backups: 32

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
ozsuakin
Posts: 1
Joined: 08 Feb 2018, 22:59

Re: Custom login with facebook.

Postby ozsuakin » 09 Feb 2018, 19:03

Hi, didnt you need to encrypt the access token key?

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 106 guests