Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6079919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:00:07+00:00 2026-05-23T11:00:07+00:00

I am building a facebook game using ASP.Net MVC3. (More like Mafia Wars and

  • 0

I am building a facebook game using ASP.Net MVC3. (More like Mafia Wars and less like Farmville in terms of technology and look and feel).
Almost all of the actions of the game will be triggered by Javascript (which calls a REST api) that we have written.

Now, our game authentication is done using Facebook’s JS SDK and we also ask for offline access permission. So we save the auth_token in our DB the first time a user signs up.

I want to know what would be the best way to access the id of the user for operations performed within the application from the point of view of security (and making it hard for people to spoof ids)

I know of the following ways:

  1. Store it in a Global javascript variable and load it on every page load using the JS SDK. (bad idea because this can easily be changed in Firebug)

  2. Read the value from server side using the fbs_[app-id] cookie that is set. (again, I was able to change the value in the cookie which got posted to the server)

  3. Use the C# SDK and do an API fetch (for /me) to get the ID using the auth_code which is supplied in the cookie (by far the safest way – but also the slowest)

Any pointers would be greatly appreciated.
Also please let me know if I am getting excessively paranoid about this.

I am sure there must be a clean, simple, secure method which I have overlooked!

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:00:07+00:00Added an answer on May 23, 2026 at 11:00 am

    I guess I’ll just put down what we are doing – incase someone stumbles upon this later.
    I checked out Zynga’s Mafia Wars and found my facebook id peppered at almost 6 to 7 places throughout the page in the HTML code.

    I guess one could try fooling around and modifying it using Firebug – but the quantity of obfuscated javascript out there, one would need to be decently motivated to do it.

    However, what we have ended up doing is follows.
    Our game asks for offline access to the user – so the access token that we get in the first login, is saved in our DB.

    Then everytime the user performs an action, the facebook cookie associated with the account is returned to us out of which we pull out the access token.

    We then do a lookup on our own DB for the user id corresponding to this access token.
    If the user id is not found (for a new user, say), we do a GET(“me”) using the facebook api to get the user id.

    It is slightly ineffective – but I guess will do for the time being. Will update this if we end up doing something else. Maybe we just are over analysing things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently building a Facebook Application for a client using the new timeline layout
Just getting started building an app using the v6 of the facebook c# sdk
For my browser based Flex game (for the Facebook platform), I am using PHP
I am building an Facebook IFrame App. I am using the below javascript code
I'm building a website that allows user to connect using Facebook Connect. So far
I am building a facebook app using heroku. I used: gem install taps It
I am building a facebook platform web app using GWT and hosting it on
I'm building a Facebook-like wall and wish to retrieve all updates from both the
i'm building a RoR app for facebook using FBML and the Prototype JavaScript library.
I'm building a Facebook app called Lovers , using a Sinatra app on Heroku

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.