https://accounts.google.com/o/oauth2/token.
This page https://developers.google.com/accounts/docs/OAuth2WebServer has instructions which I used before (and were working). Of particular interest is the step in question: POST /o/oauth2/token HTTP/1.1 Host: accounts.google.com Content-Type: application/x-www-form-urlencoded code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7& client_id=8819981768.apps.googleusercontent.com& client_secret={client_secret}& redirect_uri=https://oauth2-login-demo.appspot.com/code& grant_type=authorization_code
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/374a3b0e-7e00-4ad9-9147-b8344ee16ee3%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.
Are you doing a web server flow or an out-of-band installed app flow? The instructions you linked are for the former, but the redirect URI in your post is for the latter. I suspect that the client ID you are using is set up in the cloud console for the server flow and that the request is failing because of the redirect_uri mismatch.The fix depends on what you're trying to accomplish. If you're trying to get a refresh token for your back end, the answer is probably to set up a redirect_uri on your server, and have the token sent there. If you only need access tokens for your extension, and the user will be signed into Chrome, then you can use the Identity API. For both of those (or any other OAuth flow), you need to make sure the configuration of your client ID in the console matches the flow you are implementing.
On Tue, Nov 5, 2013 at 11:25 PM, Cyrus Adkisson <cyru...@gmail.com> wrote:
I was developing a chrome extension earlier this year and just picked it back up tonight. Naturally, I've had to put a lot of the pillars back into place to make the thing work and actually did pretty well, until I got stuck.My extension allows people to login with google. To this end, I have a google app registered for API access and a login button within the extension's overlay pane. When I click on it, my web services backend is able to generate a code, but then receives "Bad Request" when attempting to turn that code into an access token via a POST tohttps://accounts.google.com/o/oauth2/token.This pagehttps://developers.google.com/accounts/docs/OAuth2WebServer has instructions which I used before (and were working). Of particular interest is the step in question:POST /o/oauth2/token HTTP/1.1 Host: accounts.google.com Content-Type: application/x-www-form-urlencoded code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7& client_id=8819981768.apps.googleusercontent.com& client_secret={client_secret}& redirect_uri=https://oauth2-login-demo.appspot.com/code& grant_type=authorization_codeMy backend, written in Java, mimics this. Just before the request is sent (generating the ClientProtocolException Bad Request), I have my code printing out the HttpPost body:code=4%2FgagcQkdnAoW9sFoll_GbzwZAbklf.EmblahblahblahblahbHFYhAI&client_id=205434384707-n5m763hklublahblahblabhblaho8h.apps.googleusercontent.com&client_secret=HIDDEN&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&grant_type=authorization_code
... which looks fine to me. And keep in mind, this all was working when I left it in February.So has something changed? Does anything about my /token targetted postbody look odd? How can I get more information other than just "Bad Request" to help troubleshoot?Thanks for any help you might be able to provide.Cyrus
--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.