Client login using token

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

Moderators: Lapo, Bax

User avatar
rlaksana
Posts: 14
Joined: 15 Apr 2019, 11:57

Client login using token

Postby rlaksana » 05 Mar 2020, 05:08

Hi,

I need to be able to login to server using token.

1. Client connect to sfs2x
2. Client sending a token
3. Server contact external server to retrieve username, balance, nickname, etc
4. Server use the username to login the player

My idea is that client sent a loginrequest that include token in its param, then if successfully authenticated on external server, i will change the username. if unsuccesful then I will throw SFSLoginException.

Thank you,
Richard
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Client login using token

Postby Lapo » 05 Mar 2020, 15:05

Hi,
it seems feasible but what is the point of a client-generated token?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
rlaksana
Posts: 14
Joined: 15 Apr 2019, 11:57

Re: Client login using token

Postby rlaksana » 06 Mar 2020, 00:46

My game is part of a multi game. Where user login from website and can just klik "play" without needing to login manually.

Regards,
Richard
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Client login using token

Postby Lapo » 06 Mar 2020, 08:42

So the user logs in in your system before connecting to SFS2X... Correct?

Since your post didn't contain any specific questions, I am not sure what you were asking. Or if you just wanted confirmation that it is possible to implement this system, which it is.

We posted an article on our blog that explains the flow of this login system:
https://smartfoxserver.com/blog/integra ... foxserver/

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
rlaksana
Posts: 14
Joined: 15 Apr 2019, 11:57

Re: Client login using token

Postby rlaksana » 07 Mar 2020, 05:07

Hi,
Yes, people will visit a website and login as player.
Then they can browse games.
Afterward they just need to click play.

You are right. I am asking if my idea is a good practice for sfs2x or if there is a better way.
Thank you for the links, that is exactly what I'm looking for.

Regards,
Richard

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 110 guests