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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:07:58+00:00 2026-06-01T17:07:58+00:00

I’m creating a mobile app using Sencha Touch and PhoneGap. I want to be

  • 0

I’m creating a mobile app using Sencha Touch and PhoneGap. I want to be able to allow users to log into the app using their Google credentials but am hitting a brick wall with the initial request with the following error:

The redirect URI in the request: http://localhost did not match a registered URI.

My Google API account has the default 2 URIs registered (http://localhost and urn:ietf:wg:oauth:2.0:oob).

I have tried both of these with no success.

The request I am sending contains the following query string params:

  • response_type: ‘code’
  • client_id: <client id>
  • redirect_uri: ‘http://localhost‘
  • scope: ‘https://www.googleapis.com/auth/plus.me‘

The basic process is:

  • build URL as above
  • open new browser window (using ChildBrowser PhoneGap plugin)
  • navigate to the URL
  • at this point the Google login page shows and allows me to put in credentials
  • after Login tap i am taken to an error page containing the above error.

I am testing this in the iPhone simulator and on my iPhone with the same result in both. The application doesn’t apear to run on the http://localhost url but on file:///var/mobile/Applications/<guid>/<app name>/www/index.html but there is no option to add this in the Google Console (..or is there? 🙂 )

Does anyone have any suggestions about why this isn’t working? I have little to no experience with using OAuth and Google’s APIs so any little hints are more than welcome!

Thanks in advance

Stuart

  • 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-01T17:07:59+00:00Added an answer on June 1, 2026 at 5:07 pm

    I suggest you to read this as the best starting point for Google API with OAuth2, and in your case you need this: OAuth2 for Devices.

    Probably you are using the wrong endpoint, to request for a user code, you need to use the following endpoint:

    https://accounts.google.com/o/oauth2/device/code
    

    This is an example using curl (in your case to authorize the access to the Google+ API):

    curl https://accounts.google.com/o/oauth2/device/code -d "client_id=**your_client_id**" -d "scope=https://www.googleapis.com/auth/plus.me" -d "redirect_uri=urn:ietf:wg:oauth:2.0:oob"
    

    You’ll get an answer like this:

    {
      "device_code" : "4/AToZcyQ7U1BTV-xu4LAqpw02SgIW",
      "user_code" : "bqsj67hb",
      "verification_url" : "http://www.google.com/device",
      "expires_in" : 1800,
      "interval" : 5
    }
    

    Then you need to ask for authorization, showning the user the user_code and the verification_url to “pair” your app with the user account of the user. Here there is a good example of this or from the documentation:

    After your application has shown the user the user_code and the verification_url, your application may begin polling a Google endpoint with the device_code that was returned with the user_code and verification_url. The URL of the endpoint to poll is https://accounts.google.com/o/oauth2/token, and the interval between requests is specified as the interval in seconds.

    The last step, ask for an access_token, using curl:

    curl https://accounts.google.com/o/oauth2/token -d "client_id=**your_client_id**&client_secret=**your_client_secret**&code=**the _device_code_obtained_before**&grant_type=http://oauth.net/grant_type/device/1.0" 
    

    you’ll get an response like this:

    {
      "access_token" : "y23r9.AHES6ZT78qJl14pTueruthfh5676TYDF234-Eme33iQ",
      "token_type" : "Bearer",
      "expires_in" : 3600,
      "id_token" :  "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXVkIjoiNzgyMTM3OTUzMjkwLmFwcHMuZ29vZ2iLCJ0b2tlbl9oYXNoIjoiUUt0YmxTZUdsRUdNOVdPcUliRGR2QSIsImlhdCI6MTMzNDE3MDI1NywiZXhwIjoxMzM0MTc0MTU3fQ.Iz_Sv9X2fCydj4VfEdDxwWVH70DEK-rSzA5pWV9bvBdYB5VwgwFd8CSnotesDzJxq5pSKGwnAgvBfxSUbuGVmdET3E2sbrLODKymO9FoBzenfVooCwRXurzxvjKWF1EL3007lOPzTx9UGjqwShjjKQRoNjLFs-OmGCJsZGTHTGE",
      "refresh_token" : "1/gjgpKUyppp223s43HMerTX-zS_2JUxQOCk"
    }
    

    and finally you can access the services you have granted (don’t forget to configure the access from the API console, in your case the Google+ API) with the access_token obtained.

    curl https://www.googleapis.com/plus/v1/people/me?access_token=y23r9.AHES6ZT78qJl14pTueruthfh5676TYDF234-Eme33iQ
    

    Regarding the question of

    “The application doesn’t apear to run on the http://localhost url”.

    The answer is yes, this is the expected behavior. This redirect_uri is telling you where to callback after successfully granted permissions to your app. In your case a mobile device.

    In the case of “urn:ietf:wg:oauth:2.0:oob”, is not exactly a redirect. You need to “catch” or “hook” this, to simply continue your process, maybe this can help you or this.

    Good luck!

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported

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.