Using Client ID for "Web Application" always state invalid_client.

268 views
Skip to first unread message

Andreas Mattisson

unread,
Feb 13, 2013, 3:04:10 PM2/13/13
to oauth...@googlegroups.com
Hi, I have some issues regarding using the client ID for "web application", this since I need to redirect url to the webpage initiate for the Authentication with OAuth2.
I have to different Client Id, one for application where this is running on a server (C#), no issue and the redirect to the localhost works.

But for Web Application (Glassfish using servlet in Java) using the other Client ID for the "web application", this always state "invalid_client", but I don't know the reason.
If I remove the redirect uri and state the same as Client ID and secret used for "Client ID for installed applications", in the web application it is possible and I get a authorization page, but in this case I see the code that manually have to been parsed.
So I can see that the web app work with the first Client ID I created, but not the one created for Web application.
I have tripple-verified that the correct ID is used..
I have also created different web application Client Id's, to see if there was any error.
Also URL Encoded the link, but no different.

I have also used 2 difference samples to go thru if there was anything i missed, but they give the same results.

http://code.google.com/p/google-oauth-java-client/wiki/OAuth2

https://code.google.com/p/google-plus-java-starter/source/browse/#hg%2Fweb-app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fapi%2Fsample

On the auth page: https://accounts.google.com/o/oauth2/auth.. this is what I get

Fel:invalid_client

Please help me out what this issue is all about ..!

Thanks in advance

Naveen Agarwal

unread,
Feb 13, 2013, 4:26:38 PM2/13/13
to oauth...@googlegroups.com

Have you registered your redirect_uri in the developer console (https://code.google.com/apis/console/)?
Also if you are not aware of OAuth2 Playground, you can see how the request looks like and compare your request.
https://developers.google.com/oauthplayground/

Thanks

Naveen

--
You received this message because you are subscribed to the Google Groups "Developer Forum for Google API Access using OAuth2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oauth2-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Primmer

unread,
Feb 14, 2013, 12:14:03 AM2/14/13
to oauth2-dev
We think we've identified an issue regarding invalid_client but we need the client id that you redacted in your report to follow up.


On Wed, Feb 13, 2013 at 12:04 PM, Andreas Mattisson <andreas....@gmail.com> wrote:

--

Andreas Mattisson

unread,
Feb 14, 2013, 2:22:20 AM2/14/13
to oauth...@googlegroups.com
Hi again,

I have found the issue to this, and the workaround for the moment.
David Primmer
First of the client_id of the second created client_id: 401550232893-f7vpi5io91apk7o1n10gaeanopvb605n.apps.googleusercontent.com

So to my conclusion and workaround:
When Creating 2 Client Id for the SAME project, the second Client ID will always be bigger in length. The first one will work, but since this was used for "Installed application" and in use this cannot be changed.
The Second never worked "Client Id for Web Application", since invalid_client always was reported.

If instead I create a Second Project, and the first Client ID I create is for "Web Applications" and specify the redirect URI, the Client ID is shorter in length, like the First Client ID in the first Project.
This workaround work for me, and the OAuth2.0 Passes now for the Web Application.

So in other words, Currently for every Client ID that should be used, I have to create a new Project for each Client ID to be working.
Reply all
Reply to author
Forward
0 new messages