Author Topic: Facebook  (Read 2463 times)

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Facebook
« on: June 11, 2010, 06:55:13 AM »
In the most broad sense (implementation, promotion), how do I integrate an existing game with Facebook? Everything I need to know, perfectly if the minimum route is given.

I think there need to be done (simpliest route):
- download SDK
- make register via facebook (asks for username only)
- make login via facebook
- create facebook "Page" with the game description and link
Questions:
- what happens when the session expires?
- how to store the facebook data? I was thinking about a separate "socialnetwork" table that holds only FB userid. The normal user table is filled this way: asked for username, password & email left blank (login via normal (non FB) page disabled if password == NULL)
« Last Edit: June 11, 2010, 07:04:27 AM by Chris »

Offline Harkins

  • Level 28
  • **
  • Posts: 420
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Facebook
« Reply #1 on: June 11, 2010, 09:23:51 AM »
The docs (such as they are) are on the wiki: http://wiki.developers.facebook.com Sounds like you're looking to start with Facebook Connect just for logins.

Quote
- what happens when the session expires?

When the user's Facebook session expires is irrelevant. When yours expires, do whatever you usually do. Maybe you're asking something I'm not getting?

Quote
- how to store the facebook data? I was thinking about a separate "socialnetwork" table that holds only FB userid. The normal user table is filled this way: asked for username, password & email left blank (login via normal (non FB) page disabled if password == NULL)

You can do that, yes. The cleanest way is to separate your authentication data from your player data. So the Player table has things like in-game name, RPG stats, whatever game data you have. The Login table has username/password combos and links to the Player table. Maybe you also have a FacebookLogin table with uids in it.

Alternately, you can just add a facebook_uid column to your existing user table and make the username/password/email fields optional.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #2 on: June 14, 2010, 07:09:49 AM »
Quote
- what happens when the session expires?

When the user's Facebook session expires is irrelevant. When yours expires, do whatever you usually do. Maybe you're asking something I'm not getting?
I was asking because I saw "connected" icon in gnohwars, thought it might be something with FB. So, basicly I need to add "LoginViaFacebook" button on each page where I have normal login form.

I also wonder if I should go for standalone (game in a separate page) or canvas (inside FB).

Is 32 bit integer for FB_uid enough?

Any other tips from people who have FB interegrated game already? Am I missing something?

Offline gnoh

  • Game Owner
  • Level 15
  • *
  • Posts: 120
  • Reputation: +2/-0
    • View Profile
    • gnohwars.com
Re: Facebook
« Reply #3 on: June 14, 2010, 07:28:43 AM »
Nah, that's part of an effort to stop people using the browsers refresh button.  The face book identifiers they give you are strings.
Gnoh Wars          -> http://www.gnohwars.com/
Battle For Gnoh    -> http://apps.facebook.com/battleforgnoh

Offline gnoh

  • Game Owner
  • Level 15
  • *
  • Posts: 120
  • Reputation: +2/-0
    • View Profile
    • gnohwars.com
Re: Facebook
« Reply #4 on: June 14, 2010, 09:57:00 AM »
Gnoh Wars          -> http://www.gnohwars.com/
Battle For Gnoh    -> http://apps.facebook.com/battleforgnoh

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #5 on: June 20, 2010, 08:15:45 AM »
Is there any simple example of BBG style login/register system with optional facebook login? All I have seen so far are heavy, full blown FB integration examples.

By the way, I find it amusing that people tend to make tons of useless & repetitive tutorials/examples (like "BBG framework number 10544") while basicly no one make usefull things (like tutorial with source code of a sample BBG integrated with FB) :)

Offline gnoh

  • Game Owner
  • Level 15
  • *
  • Posts: 120
  • Reputation: +2/-0
    • View Profile
    • gnohwars.com
Re: Facebook
« Reply #6 on: June 20, 2010, 10:03:11 AM »
They're just user providers, it's basically just a matter of taking a variable they provide like a uid and linking it in to your own account system.

If I were you i'd probably just use rpxnow and i'd pay for the social widget and reward players for publishing.





Gnoh Wars          -> http://www.gnohwars.com/
Battle For Gnoh    -> http://apps.facebook.com/battleforgnoh

Offline bbgames

  • Level 16
  • *
  • Posts: 138
  • Reputation: +1/-0
    • View Profile
    • Building Browsergames
Re: Facebook
« Reply #7 on: June 20, 2010, 12:58:40 PM »
By the way, I find it amusing that people tend to make tons of useless & repetitive tutorials/examples (like "BBG framework number 10544") while basicly no one make usefull things (like tutorial with source code of a sample BBG integrated with FB) :)

Check it out, a tutorial on Facebook connect and an authentication system in under 15 minutes.

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #8 on: June 21, 2010, 09:07:51 AM »
I'm starting getting it. It was confusing at the beginning since there is no differentiation of register/login (which makes sense if you think about it :)).

Where can I find some button image (small one) to use with rpxnow. Like "Connect with (and here icons of the social networks)" or something whatever should be used for such button. Or drop some examples of sites that used it.
(I'm social network disabled :), so I'm very good at not noticing any social network features on the internet, so feel free to drop some obvious examples/info that everyone except me knows already)

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #9 on: June 21, 2010, 05:22:08 PM »
Does it make any sense to allow linking more than one social network with one player? Like you can login via facebook and twitter (and both will login you as the same player)?

Offline gnoh

  • Game Owner
  • Level 15
  • *
  • Posts: 120
  • Reputation: +2/-0
    • View Profile
    • gnohwars.com
Re: Facebook
« Reply #10 on: June 21, 2010, 05:32:15 PM »
Yep that's  considered best practice, I don't do that though I might do eventually if I ever get around to building an external account system to be shared amongst my games.  Although I need to finish one of them first :)
Gnoh Wars          -> http://www.gnohwars.com/
Battle For Gnoh    -> http://apps.facebook.com/battleforgnoh

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #11 on: June 27, 2010, 12:31:56 PM »
Geez, didn't know that BBG players hate FB so much. After announcing plans for FB integration I regularly need to explain that it won't spam their profiles and that it is optional and things like that.

I wonder if putting the FB connect button on the homepage will be a smart move...

Offline Harkins

  • Level 28
  • **
  • Posts: 420
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Facebook
« Reply #12 on: June 27, 2010, 01:46:43 PM »
Geez, didn't know that BBG players hate FB so much. After announcing plans for FB integration I regularly need to explain that it won't spam their profiles and that it is optional and things like that.

I've seen people split-test phrases to put under their FB login button like "We never post to your wall without your permission" and such.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline gnoh

  • Game Owner
  • Level 15
  • *
  • Posts: 120
  • Reputation: +2/-0
    • View Profile
    • gnohwars.com
Re: Facebook
« Reply #13 on: June 27, 2010, 03:36:03 PM »
You can't post on the wall without there permission anyway,   It's getting even worse with the new data permissions coming into play in a few days.

You've already got rpxnow set up why don't use use there built in facebook implementation and pay for the social widget each publish requires there permission and what I do is reward my players for posting as you do for voting.  The callback from the reward widget actually says if they published or not as well so it's less vulnerable to abuse than your current voting system as well.

Since each post generates on average 3-4 clicks I'm guessing it'll be more valuable for you than the the top lists you already reward for.
Gnoh Wars          -> http://www.gnohwars.com/
Battle For Gnoh    -> http://apps.facebook.com/battleforgnoh

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #14 on: September 17, 2010, 08:03:12 AM »
How to make long screen inside canvas?

When I set it to "IFrame + Auto-resize" the page has predefined height and bottom is cut (while I saw some games inside FB that have the page adjust its height). How they did it?

Offline BlackScorp

  • Level 14
  • *
  • Posts: 111
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Facebook
« Reply #15 on: May 17, 2011, 06:30:42 AM »
they did it with JavaScript SDK from Facebook. actually i saw another nice ide how to implement a game to facebook. They added in the iframe the server selection, after selecting a server a popup was opened with the full game.

http://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/
« Last Edit: May 17, 2011, 06:47:52 AM by BlackScorp »

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #16 on: May 19, 2011, 04:09:31 AM »
Quote
Dear Developer of LordsTestServer,

Our automated systems have detected that you may be inadvertently allowing authentication data to be passed to 3rd parties. Allowing user ids and access tokens to be passed to 3rd parties, even inadvertently, could allow these 3rd parties to access the data the user made available to your site. This violates our policies and undermines user trust in your site and Facebook Platform.

In every case that we have examined, this information is passed via the HTTP Referer Header by the user's browser. This can happen when using our legacy authentication system and including <iframe>, <img> or <script> content from 3rd parties in the page that receives authentication data from Facebook. Our legacy mechanism passes authentication information in the URL query string which, if handled incorrectly, can be passed to 3rd parties by the browser. Our current OAuth 2.0 authentication system, released over a year ago, passes this information in the URL fragment, which is not passed to 3rd parties by the browser.

Please ensure that you are not allowing this data to be passed immediately. Accessing your site as a test user while running a HTTP proxy/monitor like Charles or Fiddler is the best way to determine if you are allowing this information to be passed. If you discover the issue, you can do one of two things:

1. Migrate your site to use our OAuth 2.0 authentication system. We are requiring all apps and sites to update to this mechanism by Sept. 1, 2011. Migrating now will address this issue and ensure that you are one of the first to meet the deadline. For more details, please see our Authentication Guide.

2. Create and use an interstitial page to remove the authentication data before redirecting to your page with 3rd party content. This approach is used by many of our largest developers today (although they are all migrating to OAuth 2.0 shortly). This is a simple and straightforwardchange that should have minimal impact on your site. For more details on this approach, see our Legacy Connect Auth doc.

Because of the importance of ensuring user trust and privacy, we are asking you to complete one of the above steps in the next 48 hours. If you fail to do so, your site may be subject to one of the enforcement actions outlined in our policies.

If you have any questions or believe you have received this message in error, please contact us.

Facebook Developer Relations
Does anyone understand what they want? :D
It's about this app: http://apps.facebook.com/lordstestserver/



Offline Harkins

  • Level 28
  • **
  • Posts: 420
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Facebook
« Reply #17 on: May 19, 2011, 05:30:49 AM »
You're using their legacy auth mechanism, which loads your app with a url like yourgame.com/facebook.php?secret=123&moreinfo=456. If the user loads an iframe or clicks a link from your page, the querystring variables used for authentication will get passed on to another site.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #18 on: May 19, 2011, 05:46:58 AM »
You're using their legacy auth mechanism
LOL, so in short they messed up with their SDK and now want me to replace it with a new one they made that is not as much messed up as the old one or I face consequences :D This is really funny :D

OK, anyone, can you drop the link to the CURRENT facebook docs/tutorials that WORKS and have a chance to not being outdated too soon?

Offline BlackScorp

  • Level 14
  • *
  • Posts: 111
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Facebook
« Reply #19 on: May 19, 2011, 09:11:05 AM »

Offline Harkins

  • Level 28
  • **
  • Posts: 420
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Facebook
« Reply #20 on: May 19, 2011, 05:41:06 PM »
have a chance to not being outdated too soon?

Heheheh. Facebook breaks stuff constantly. This is the tax you pay if you want to integrate with them, basically you have to redo something every two or three weeks.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Mufasa

  • Game Owner
  • Level 18
  • *
  • Posts: 189
  • Reputation: +3/-0
  • Maniac Developer
    • View Profile
Re: Facebook
« Reply #21 on: May 21, 2011, 10:07:49 AM »
have a chance to not being outdated too soon?

Heheheh. Facebook breaks stuff constantly. This is the tax you pay if you want to integrate with them, basically you have to redo something every two or three weeks.

Too true, and sad. We ditched the platform.

Offline Freyr

  • Level 7
  • *
  • Posts: 30
  • Reputation: +1/-0
    • View Profile
Re: Facebook
« Reply #22 on: May 23, 2011, 04:21:30 PM »
Facebook is requiring that all application must use OAuth 2.0, which in turn also means that you will need to provide your content trough an SSL layer.
In simple terms that means you need a cert for applications.

I don't know why they are mailing you now, but it's only going to come in effect officially on 1 June/July.

See here: http://developers.facebook.com/blog/post/497

Quote
Dear Developer of LordsTestServer,

Our automated systems have detected that you may be inadvertently allowing authentication data to be passed to 3rd parties. Allowing user ids and access tokens to be passed to 3rd parties, even inadvertently, could allow these 3rd parties to access the data the user made available to your site. This violates our policies and undermines user trust in your site and Facebook Platform.

In every case that we have examined, this information is passed via the HTTP Referer Header by the user's browser. This can happen when using our legacy authentication system and including <iframe>, <img> or <script> content from 3rd parties in the page that receives authentication data from Facebook. Our legacy mechanism passes authentication information in the URL query string which, if handled incorrectly, can be passed to 3rd parties by the browser. Our current OAuth 2.0 authentication system, released over a year ago, passes this information in the URL fragment, which is not passed to 3rd parties by the browser.

Please ensure that you are not allowing this data to be passed immediately. Accessing your site as a test user while running a HTTP proxy/monitor like Charles or Fiddler is the best way to determine if you are allowing this information to be passed. If you discover the issue, you can do one of two things:

1. Migrate your site to use our OAuth 2.0 authentication system. We are requiring all apps and sites to update to this mechanism by Sept. 1, 2011. Migrating now will address this issue and ensure that you are one of the first to meet the deadline. For more details, please see our Authentication Guide.

2. Create and use an interstitial page to remove the authentication data before redirecting to your page with 3rd party content. This approach is used by many of our largest developers today (although they are all migrating to OAuth 2.0 shortly). This is a simple and straightforwardchange that should have minimal impact on your site. For more details on this approach, see our Legacy Connect Auth doc.

Because of the importance of ensuring user trust and privacy, we are asking you to complete one of the above steps in the next 48 hours. If you fail to do so, your site may be subject to one of the enforcement actions outlined in our policies.

If you have any questions or believe you have received this message in error, please contact us.

Facebook Developer Relations
Does anyone understand what they want? :D
It's about this app: http://apps.facebook.com/lordstestserver/



// this is a comment

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: Facebook
« Reply #23 on: September 04, 2011, 06:14:55 AM »
Any news on the OAuth 2.0? It's after 1 June/July. Have they made it obligatory already? Have all outdated apps stopped working/were banned?

Offline Ben Adams

  • Level 4
  • *
  • Posts: 13
  • Reputation: +2/-0
    • View Profile
    • Illyriad - Dev Blog
Re: Facebook
« Reply #24 on: September 04, 2011, 10:55:11 AM »
Secure Canvas URL will be required on October 1, 2011 - not sure about the dates on OAuth
Currently working on Illyriad a real-time, HTML5 Massively-Multiplayer strategy game.

Illyriad - Dev Blog

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal