Keept getting Redirect URI mismatch

18,684 views
Skip to first unread message

Sumit

unread,
May 8, 2011, 10:46:44 PM5/8/11
to GTM OAuth 2 Discussion
Hi,

I registered my app on the API console and got a client ID and secret
key for my app and provided the Client ID and secret key in the
application.
When I hit sign in on the app it shows me google login screen. I
provide username/password and it gives me redirect_uri_mismatch 400
error. Initially the redirectUri value was the default one. Then I
changed it to reflect the redirect uri registered with my application.
In both cases I am getting the redirect_uri_mismatch.

I want to retrieve data from Google Latitude so my client id is setup
for Latitude.

Am I missing something really obvious? I am new to iOS and OAuth.

Please help or point to some documentation for some simple scenarios
that works out of the box.

Thanks and Regards,
Sumit.

Greg Robbins

unread,
May 8, 2011, 11:34:11 PM5/8/11
to gtm-o...@googlegroups.com
Typically, the redirect_uri_mismatch error indicates the client ID and secret were issued for a web application. In Google's developer console, they should be created for an installed application.

Greg Robbins

unread,
May 8, 2011, 11:59:21 PM5/8/11
to gtm-o...@googlegroups.com
As far as I'm aware, the Latitude API supports only OAuth 1, not yet OAuth 2.  Other Google APIs support OAuth 2.

Sumit

unread,
May 9, 2011, 1:09:32 AM5/9/11
to GTM OAuth 2 Discussion
Greg,

Thanks a ton for your quick response. You are absolutely right. I was
using the wrong project type. I registered a client application and
things started working.

Also thanks for the pointer on Latitude's lack of Oauth 2.0 support. I
am basically wetting my feet with OAuth on iOS, your heads-up is going
to save me some more head scratching.

Regards,
Sumit.

Kalai Selvi S

unread,
Sep 3, 2013, 12:53:37 AM9/3/13
to gtm-o...@googlegroups.com


On Tuesday, August 28, 2012 12:53:45 PM UTC+5:30, Rinku Yadav wrote:
Hi Rinku,


I am got this same issue when integrating Google plus API to xcode project..If you found any possible solution please help me

R Anusha

unread,
Jan 22, 2014, 11:55:00 PM1/22/14
to gtm-o...@googlegroups.com

Hi ,
I got the same issue. can you please help me for solving the issue if you have solved this problem.

Thanks,

RIOT Van Hooligan

unread,
May 9, 2014, 10:58:15 AM5/9/14
to gtm-o...@googlegroups.com
3 years old and still relevant to google nwbs.  :)

I too was guilty as charged. Remade client id using correct type (for native application) and I'm up and running.

Thanks Greg.

Felix Rabe

unread,
Oct 27, 2014, 8:08:10 AM10/27/14
to gtm-o...@googlegroups.com
This does not work for me. I have created a client ID for "Installed Application / Other" as I am building a desktop application in Go (so 100% sure it is the correct type), but whatever combination I try of the following (the mentioned URIs are listed in the dev console), I can't get beyond redirect_uri_mismatch:

- redirect_uri=urn:ietf:wg:oauth:2.0:oob // redirect_uri=http://localhost // redirect_uri=http://localhost:<some_port_i_am_listening_on>

- encoding the string manually to match the format shown in https://developers.google.com/accounts/docs/OAuth2InstalledApp#handlingtheresponse (i.e. "...&redirect_uri=http://localhost&...") // encoding the string via Go's net/url.Values.Encode (i.e. "...&redirect_uri=http%3A%2F%2Flocalhost")

Any help appreciated. By now I suspect either the OAuth2InstalledApp docs to be outdated/incorrect or me to be plain stupid. For my own sake I hope it's the former (;

Felix Rabe

unread,
Oct 27, 2014, 11:19:16 AM10/27/14
to gtm-o...@googlegroups.com

Solved! Solution: Keep using the same port number in both instances of redirect_uri (I hadn't).

--
You received this message because you are subscribed to a topic in the Google Groups "GTM OAuth 2 Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gtm-oauth2/_fHKizx8Kco/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gtm-oauth2+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

IOS Test

unread,
Nov 27, 2014, 2:46:24 AM11/27/14
to gtm-o...@googlegroups.com, sum...@gmail.com
I was using a existing project and the bundle identifier was different. I slaved this by changing the bundle identifier

mehta vikas

unread,
Sep 14, 2016, 7:18:00 AM9/14/16
to GTM OAuth 2 Discussion, sum...@gmail.com
Same problem is here

akash ingale

unread,
Jan 30, 2017, 9:51:39 AM1/30/17
to GTM OAuth 2 Discussion
i have same problem i am using all localhost n all nut still not working
redirect uri mis-match error is occured
please help me

Бажен Ржеутский

unread,
Jun 22, 2017, 2:14:31 PM6/22/17
to GTM OAuth 2 Discussion, sum...@gmail.com
I've found an answer how made it works. Please have a look on my comment here https://stackoverflow.com/a/44706474/5023697

понедельник, 9 мая 2011 г., 9:46:44 UTC+7 пользователь Sumit написал:
Reply all
Reply to author
Forward
0 new messages