1

I was trying to implement oauth javascript client using Google app engine oauth end points. I registered my myapp.appspot.com domain with my google account. I was able to retrieve the verification. But received a 400 error trying to fetch the access token. Did anyone successfully receive an access token from Google app engine end points? If so please help me. Using the following code.

    function getRequestToken() {
    token = {};
    oauthRequest("https://myapp.appspot.com/_ah/OAuthGetRequestToken" , { oauth_callback: "https://myapp.appspot.com/index"}, gotRequestToken);
  }
    function gotRequestToken() {
    parseToken(req.responseText);
    authorize();
    }
    function authorize() {
        deleteTab = false;
    chrome.tabs.create({
        "url":"https://myapp.appspot.com/_ah/OAuthAuthorizeToken?oauth_token=" +     token.oauth_token,
        "selected":true
    }, function(theTab) {
        if(deleteTab){
        chrome.tabs.remove(theTab.id);
      } else {
        deleteTab = theTab;
      }
    });

when i granted access to myapp.appspot.com, i get a oauth_verifier in the url, which i successfully captured and passed to the following request.

oauthRequest("https://myapp.appspot.com/_ah/OAuthGetAccessToken", {  "oauth_verifier":     data.verifier }, gotAccessToken);
function gotAccessToken() {
alert ('got access token');
parseToken(req.responseText);
storeToken();
}

But it is this final access token request that fails! giving 400 error. And am using oauthsimple javascript library.

0 Answers0