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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:50:16+00:00 2026-06-10T22:50:16+00:00

I have an iOS which uses OAuth and OAuth2 providers (Facebook, google, twitter, etc)

  • 0

I have an iOS which uses OAuth and OAuth2 providers (Facebook, google, twitter, etc) to validate a user and provide access tokens. Apart from minimal data such as name and email address, the app doesn’t uses these services for anything except authentication.

The app then sends the access token to a server to indicate that the user is authenticated.

The server is written in Node.js and before doing anything it needs to validate the supplied access token against the correct OAuth* service.

I’ve been looking around, but so far all the node.js authentication modules I’ve found appear to be for logging in and authenticating through web pages supplied by the server.

Does anyone know any node.js modules that can do simple validation of a supplied access token?

  • 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-10T22:50:18+00:00Added an answer on June 10, 2026 at 10:50 pm

    To the best of my knowledge (and as far as I can tell from reading the specifications) the OAuth and OAuth 2 specs do not specify a single endpoint for access token validation. That means you will need custom code for each of the providers to validate an access token only.

    I looked up what to do for the endpoints you specified:

    Facebook

    It seems others have used the graph API’s ‘me’ endpoint for Facebook to check if the token is valid. Basically, request:

    https://graph.facebook.com/me?access_token={accessToken}
    

    Google

    Google have a dedicated debugging endpoint for getting access token information, with nice documentation, too. Basically, request:

    https://www.googleapis.com/oauth2/v1/tokeninfo?access_token={accessToken}
    

    However, they recommend that you don’t do this for production:

    The tokeninfo endpoint is useful for debugging but for production
    purposes, retrieve Google’s public keys from the keys endpoint and
    perform the validation locally. You should retrieve the keys URI from
    the Discovery document using the jwks_uri metadata value. Requests to
    the debugging endpoint may be throttled or otherwise subject to
    intermittent errors.

    Since Google changes its public keys only infrequently, you can cache
    them using the cache directives of the HTTP response and, in the vast
    majority of cases, perform local validation much more efficiently than
    by using the tokeninfo endpoint. This validation requires retrieving
    and parsing certificates, and making the appropriate cryptographic
    calls to check the signature. Fortunately, there are well-debugged
    libraries available in a wide variety of languages to accomplish this
    (see jwt.io).

    Twitter

    Twitter doesn’t seem to have a really obvious way to do this. I would suspect that because the account settings data is pretty static, that might be the best way of verifying (fetching tweets would presumably have a higher latency?), so you can request (with the appropriate OAuth signature etc.):

    https://api.twitter.com/1.1/account/settings.json
    

    Note that this API is rate-limited to 15 times per window.

    All in all this seems trickier than it would first appear. It might be a better idea to implement some kind of session/auth support on the server. Basically, you could verify the external OAuth token you get once, and then assign the user some session token of your own with which you authenticate with the user ID (email, FB id, whatever) on your own server, rather than continuing to make requests to the OAuth providers for every request you get yourself.

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

Sidebar

Related Questions

I have made an application which uses latest ios facebook sdk to connect. I
I have an IOS application which uses environment variables and am able to set
I'm working on an application for iOS which will have the user fill out
I have an iOS application which uses an UIStoryboard to control its flow. I
I have an iOS-App which uses ARC. I don't use InterfaceBuilder, all UI is
guys :) I have an iOS alarm app, which uses UILocalNotification-s to schedule the
Possible Duplicate: Getting current device language in iOS? I have an app which uses
I am building an iPhone app which uses Facebook iOS SDK and Three20. I
Im currently writing an ios app which uses google map api's to measure driving
Hi there: I have been writing an iOS program which uses many http queries

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.