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 8845847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:49:54+00:00 2026-06-14T11:49:54+00:00

We have a website where the only way to login and authenticate yourself with

  • 0

We have a website where the only way to login and authenticate yourself with the site is with Facebook (this was not my choice). The first time you login with Facebook, an account gets automatically created for you.

We now want to create an iPhone application for our site and also a public API for others to use our service.

This question is about how to authenticate with our website from the app/API and is broken into 2 parts:

  1. What is the correct way to handle REST authentication from an API to a website which only uses Facebook OAuth as an authentication method?

I have read and researched a lot about standard methods of authentication for REST API. We can’t use such methods as Basic Auth over HTTPS, as there are no credentials for a user as such. Something like this seems to be only for authenticating applications using the API.

Currently, the best way I can think is you hit an /authorize end-point on our API, it redirects to Facebook OAuth, then redirects back to the site and provides a ‘token’ which the user of the API can use to authenticate subsequent requests.

  1. For an official application that we create, we wouldn’t necessarily need to use the public API in the same way. What would be the best way then to talk to our website and authenticate users?

I understand (I think) how to authenticate 3rd-party applications that are using our API, using API (public) keys and secret (private) keys. However, when it comes to authenticating the user who is using the app, I am getting rather confused about how to go about it when the only way we have to authenticate a user is Facebook.

I feel like I’m missing something very obvious, or don’t fully understand how public REST APIs should work, so any advice and help would be greatly appreciated.

  • 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-14T11:49:55+00:00Added an answer on June 14, 2026 at 11:49 am

    UPDATE: see below

    I’ve been thinking hard about this question too. It’s not entirely clear to me yet but here’s the route I am thinking of going. I am creating a REST API an my users only auth with Facebook connect.

    On the CLIENT:

    1. Use the Facebook API to login and get an OAUTH2 code.
    2. Exchange this code for an access token.
    3. In every call to my custom API I’ll include the Facebook user id and the access token.

    On the API (for every method that requires user authentication):

    1. Make a request to the /me Facebook graph using the access token from above.
    2. Verify that the Facebook user id returned matches the user id passed to my API from above.
    3. If the access token has expired additional communication is required.

    I have yet to test this. How does it sound?

    — Update: July 27th, 2014 to answer question —

    I only use the above exchange once upon login. Once I determine which user is logging in, I create my own access token, and that token is used from that point going forward. So the new flow looks like this…

    On the CLIENT:

    1. Use the Facebook API to login and get an OAUTH2 code.
    2. Exchange this code for an access token.
    3. Request an access token from my API, including the Facebook token as a parameter

    On the API

    1. Receive access token request.
    2. Make a request to the /me Facebook graph using the facebook access token
    3. Verify that the Facebook user exists and match to a user in my database
    4. Create my own access token, save it and return it to the client to be used from this point forward
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have website where users can login with their Facebook account. I am using
I have one page website only using HTML, CSS and JavaScript. I want to
Two questions only: I have a website including a section of Blog in wordpress.
I have an existing website running on IIS6 that has only static HTML pages.
In Vaadin's website it says that only Eclipse and NetBeans have fully functional (which
On a customer website, I have to add a background image for only a
I have website on the server, which is not precompiled (with source code, so
I currently have a website that allows my visitors to login via a simple
I have an ASP.NET Website. I want to restrict the Admin Folder to only
I have created a site in ASP.NET 3.5 & I have only 2 or

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.