Forum QuickConnect facebookOAuthConnectPopup issue

Discussion and help relating to PlayerIO's QuickConnect feature, including Facebook Connect and Kongregate Connect.

facebookOAuthConnectPopup issue

Postby Aram Kirakosyan » March 28th, 2017, 2:42 pm

Hi,
Today I got this error when I tried to run game on local sendbox :

An error occured, please try again.
QuickConnect Error: Missing facebook uid


This is what I called (it has worked perfectly, but seems something changed today).
PlayerIO.quickConnect.facebookOAuthConnectPopup(_stage, GAME_ID, "_blank", ["publish_actions", "user_friends", "email"], null, null, handleConnectPopup, handleError);

Please have a look at Screen Shot I Attached
Thank You!
Attachments
Screen Shot 2017-03-28 at 5.43.16 PM.png
Screen Shot 2017-03-28 at 5.43.16 PM.png (10.77 KiB) Viewed 32025 times
Aram Kirakosyan
Paid Member
 
Posts: 8
Joined: October 11th, 2014, 10:39 pm

Re: facebookOAuthConnectPopup issue

Postby Henrik » March 29th, 2017, 11:37 am

This issue should be fixed now as well.

Please try your game again, and let us know if you have any further issues.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: facebookOAuthConnectPopup issue

Postby Aram Kirakosyan » March 29th, 2017, 11:40 am

it works now!

thank you!
Aram Kirakosyan
Paid Member
 
Posts: 8
Joined: October 11th, 2014, 10:39 pm

Re: facebookOAuthConnectPopup issue

Postby aminusia » January 14th, 2019, 2:21 am

This issue happens again.

Now for facebookOAuthConnect there is no uid error comes out, and for facebookOAuthConnectPopup Facebook enforce Https while Playerio redirects to Http.

Please fix it again. Thank You.
aminusia
Paid Member
 
Posts: 8
Joined: January 11th, 2012, 12:13 pm

Re: facebookOAuthConnectPopup issue

Postby Henrik » January 15th, 2019, 6:11 am

Hey aminusia,

Your game is a Flash game that runs in a web browser, right? Or are you on any other platforms?

What version of the Facebook Graph API is your Facebook App on? (And did they recently force an upgrade to that version?)
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: facebookOAuthConnectPopup issue

Postby aminusia » January 15th, 2019, 4:43 pm

Hey, Henrik thanks for replying.

Yes, it is a flash game on the web browser.

I just used code sample from their getting started, and apparently, it used Graph API v2.8. Don't really know if it is enforced or not. But Https connection is mandatory.

For now, below code is working, but any new user is not listed on Facebook quick connect list.

Code: Select all
PlayerIO.authenticate(
   stage,
   [GAME ID],
   "public",
   {
      userId: [FB ID],
      accessToken: [FB AccessToken]
   },
   null,
   function(client):void {
      ...
   },
   function(e:PlayerIOError):void {
      ...
   }
);


Maybe there is any suggestion for this.
aminusia
Paid Member
 
Posts: 8
Joined: January 11th, 2012, 12:13 pm

Re: facebookOAuthConnectPopup issue

Postby Henrik » January 15th, 2019, 11:01 pm

When using Authenticate, the type of user is determined by the Authentication Type of the connection in your connection settings. The 'public' connection uses Basic authentication by default, and since you're passing a userId, that's probably what's happening.

1) Change the type of the 'public' connection to Facebook, or create a new connection of that type and use that.

2) Don't pass in userId in your call to Authenticate, only pass in accessToken.

If you do that, your users will be properly verified against Facebook, and should show up in the QuickConnect user list.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: facebookOAuthConnectPopup issue

Postby Henrik » January 15th, 2019, 11:12 pm

We're slowly trying to phase out QuickConnect, and this means that facebookOAuthConnect and facebookOAuthConnectPopup will also disappear. We made those helper functions way, way, way back when Facebook integration was different. Facebook has changed their login flow a lot, and currently the way to do a Facebook game in Flash with PlayerIO is this:

1) Integrate the Facebook JS SDK on the page hosting your Flash game: https://developers.facebook.com/docs/ja ... quickstart

2) Bridge Flash to JS so you can call the FB JS SDK from Flash: https://www.adobe.com/devnet/games/arti ... ript3.html

3) Follow Facebook's guidelines for login, they now want you to first call FB.getLoginStatus(), which might result in a valid accesstoken. And only if that fails are you supposed to call FB.login(), which will spawn the FB app login dialog, and result in you getting a valid accesstoken: https://developers.facebook.com/docs/facebook-login/web

4) When you have the FB accesstoken in your Flash game, call https://playerio.com/documentation/refe ... thenticate in the PlayerIO SDK on a connection with the authentication type Facebook, and you'll get a properly logged in and validated Facebook user in your game.

(I'll update our official documentation on this right now as well)
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: facebookOAuthConnectPopup issue

Postby aminusia » January 16th, 2019, 3:06 am

I will try to move the connection from 'public' to 'Facebook', and remove userId to see if it is logged.

Actually, there are two types of user authentication for this flash game that both are troublesome. First one for Facebook that we discussed, and the other one for a game portal called ArmorGames which have its own authentication system. To simplify this, let us say that we have ArmorGames' userId and userName as identification for PlayerIO authentication.

Currently, both are using the same connection 'public' to the server. Can you give any suggestion on how to solve the second connection so that the logged in user will also be registered into QuickConnect system? Whether I should use PlayerIO.quickConnect.simpleConnect, or PlayerIO.authenticate?

Thank you for your help.
aminusia
Paid Member
 
Posts: 8
Joined: January 11th, 2012, 12:13 pm

Re: facebookOAuthConnectPopup issue

Postby Henrik » February 1st, 2019, 5:43 am

aminusia wrote:Actually, there are two types of user authentication for this flash game that both are troublesome. First one for Facebook that we discussed, and the other one for a game portal called ArmorGames which have its own authentication system. To simplify this, let us say that we have ArmorGames' userId and userName as identification for PlayerIO authentication.


Each connection can only have one type of authentication, so make two connections, one for Facebook and one for ArmorGames. If it's a Facebook user, pass in the name of the Facebook connection, along with the user access token that Facebook Authentication requires. If it's an ArmorGames user, pass in the name of the ArmorGames connection, along with the ArmorGames userid and auth token that it requires.

That way, both types of users will be securely authenticated with PlayerIO, and appear in their respective QuickConnect users tab. If you have a connection where the authentication type is Basic, anyone can log in as anyone else without any verification of the username, so you want to change that.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to QuickConnect