Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle App Engine OAuth endpoints throwing 400 in production
    primarykey
    data
    text
    <p>I implemented the <a href="http://code.google.com/appengine/docs/python/oauth/overview.html#OAuth_Endpoints" rel="noreferrer">experimental OAuth support</a> for Google App Engine using Python, and have it working locally, but the endpoints are throwing a 400 when I deploy to appspot. </p> <p>For example, the url http(s)://my-app.appspot.com/_ah/OAuthGetRequestToken returns a 400, but locally that url pattern behaves as expected. </p> <p>I have tried both http and https, and assumed that appspot handles the ssl cert.</p> <p><strong>UPDATE</strong></p> <p>I've been using the <a href="http://googlecodesamples.com/oauth_playground/" rel="noreferrer">OAuth Playground</a> to test my code. Despite documentation, it seems Registering your app <em>is</em> required. Go <a href="http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html" rel="noreferrer">here</a> for instructions on how to register. According to documentation during the registration process, certificate is not required when running on App Engine. Playground is showing more detail on the error - "signature invalid". If I understand correctly, the signature is produced from a signature base string. In this case I am using the base string 7DYB6MJ2s-IQcd7VJYJUmcct .</p> <pre><code>GET /accounts/OAuthGetRequestToken?scope=https%3A%2F%2Fmail.google.com%2Fmail%2Ffeed%2Fatom HTTP/1.1 Host: www.google.com Accept: */* Authorization: OAuth oauth_version="1.0", oauth_nonce="168cfd60a93a46caa38dddfdcedd9de9", oauth_timestamp="1305315895", oauth_consumer_key="xxxxxxx.appspot.com", oauth_callback="http%3A%2F%2Fgooglecodesamples.com%2Foauth_playground%2Findex.php", oauth_signature_method="HMAC-SHA1", oauth_signature="4J5faUujE0VNaybyvFCiEPY7DQ8%3D" HTTP/1.1 400 Bad Request Content-Type: text/plain; charset=UTF-8 Date: Fri, 13 May 2011 19:44:55 GMT Expires: Fri, 13 May 2011 19:44:55 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Content-Length: 451 Server: GSE **signature_invalid** base_string:GET&amp;https%3A%2F%2Fwww.google.com%2Faccounts%2FOAuthGetRequestToken&amp;oauth_callback%3Dhttp%253A%252F%252Fgooglecodesamples.com%252Foauth_playground%252Findex.php%26oauth_consumer_key%3Dxxxxxx.appspot.com%26oauth_nonce%3D168cf60a94caa38e2defdcedd9de9%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1305315895%26oauth_version%3D1.0%26scope%3Dhttps%253A%252F%252Fmail.google.com%252Fmail%252Ffeed%252Fatom </code></pre> <p><strong>FINAL UPDATE</strong></p> <p>There were two things causing the 400. First, the app was not registered. Google's documentation says it's optional, but that is not the case apparently. Secondly, the Request was not properly signed. <strong>Here is an excellent debugging tool to test your OAuth Requests: <a href="http://googlecodesamples.com/oauth_playground/" rel="noreferrer">Oauth Playground</a></strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload