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

  • Home
  • SEARCH
  • 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 7790243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:31:42+00:00 2026-06-01T21:31:42+00:00

I am building a javascript front-end and a Rails REST API backend. Users can

  • 0

I am building a javascript front-end and a Rails REST API backend. Users can only login using Facebook. What is the best architecture for something like this? I am a Rails and REST newbie but here’s what I’m thinking so far:

  1. Login on the client using the FB javascript library
  2. Send a request to /users/current. Include the FB token in the request. (Is this URL restful?)
  3. On the server
    • If the token is valid, fetch the users info and transmit the JSON back (id, pic, name, etc)
    • If the token is invalid, transmit an error back

Could someone please point me in the right direction? 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-06-01T21:31:43+00:00Added an answer on June 1, 2026 at 9:31 pm

    That is correct, I’m actually developing an application using same concept but through Google login.

    What you are looking for is OAuth 2.0 for Facebook or OpenID if you plan to incorporate federated login.

    So yeah, basically what you said is correct. You get the authorization token from the client, send request to the server which you should have a authentication method that checks for the validity of the token by sending a GET request for user info to facebook with that token. After you get the response, you should return the information in JSON or an error depending on the data you get back from the GET request.

    Facebook OAuth 2.0

    That should point you in the right direction. Hopefully this helps.

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

Sidebar

Related Questions

i'm building a RoR app for facebook using FBML and the Prototype JavaScript library.
I'm building an javascript api that will call some java objects using mozilla rhino.
I'm currently researching the best way to approach building a JavaScript widget someone can
I'm building a javascript application using object oriented techniques and I'm running into a
I have been using PHP and JavaScript for building my dad's website. He wants
I am building a Facebook App which is heavy on Javascript. For this I
I'm building a concert calendar that's very heavy on javascript (using jQuery). I'm having
I am building an application where most of the HTML is built using javascript.
I'm building a javascript-powered gallery on the iPad that can display both images and
MongoDB seems appealing because in JavaScript front-end applications, especially those that leverage Backbone and

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.