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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:00:19+00:00 2026-06-19T03:00:19+00:00

I’m working on an API and considering using OAuth (3-legged approach) for authentication and

  • 0

I’m working on an API and considering using OAuth (3-legged approach) for authentication and authorisation.

This is the basic idea:

  • In order for clients (mobile app or web app), to use this RESTful API the user will have to be logged in using identity providers/servers such as Google, Facebook e.t.c

Essentially 3 parties will be interacting here:

  • The mobile / web app: The one trying to access my API
  • The API: The site that contains data for the app to run
  • The identity server: The site that will allow the user to login in order to access the API

Now, the way that I understand this process (assuming I do). This would be the flow (summarised):

  • The user will try to access data from the API (consumer);
  • The consumer finds that the user is not logged in;
  • The user gets a page (with service provider buttons such as Login with Google);
  • The user clicks the button, and the service provider returns a login form;
  • The user logs in;
  • The service provider returns a page asking for specific permissions;
  • The user grants permission;
  • The service provider returns an access token to the user;
  • The user uses the access token to try the request again to the consumer (API);
  • The consumer takes the token and verifies it against the service provider;
  • The consumer grants access to the user.

First

Is this process correct (on a higher level), or have I completely misunderstood the whole thing. If it is not correct: Could you offer some tweaks?

Second

After this whole process. How does the consumer communicate with the user? Will I have to be passing around a token on every request made (between the mobile app and the API)? Or can I just use the user details from the service provider to identify the user?

Third

How exactly does the consumer (API) verifies the token provided by the user against the server? Is this already implemented in OAuth, or will I have to do it myself?

Forth and last

In terms of implementation, what would be the difference between the client (mobile app / web app) and the consumer (API)?

I’m new to this, and I am trying to implement it in PHP (the API). If you have any references to PHP code (sample implementations) or external resources, I’d really appreciate it 🙂

  • 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-19T03:00:20+00:00Added an answer on June 19, 2026 at 3:00 am

    I am also new for oauth but I’ll try to help.
    First you could look here for appropriate libraries which could help.

    As for me your oauth flow is correct. A good explanations you can also find here.
    Keep in mind that authorization server should return an authorization code which you use for obtaining access token.

    So your questions:

    1) Follow the second link and there – “Authorization Code”.

    2) With every request to you API you should send your access token. Something like

    http://<your api>?access_token=7f813af1-381d-4dd7-b70b-b6a8399b2c00
    

    3) Just use the libraries from the first link. I hope that they have already implemented this. 🙂

    4)Can’t exactly understand what you mean. Your client must be able to obtain access token, store it and send it with requests. Your API server must be able to receive access token from client, and give access to api if the access token is correct.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... 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.