OAuth 2.0 authentication silently failing in Google Blogger JavaScript API (v3)
<p>Until recently I was using the <strong>javascript Blogger API v3</strong> to fetch posts from a blog to build an automated index, using the <code>gapi.client.blogger.posts.list()</code> method.</p>

<p>However, it suddenly stopped working. The response now simply includes an error object with the message <code>"We're sorry, but the requested resource could not be found."</code>, as if the blog I'm trying to fetch info does not exist at all. I'm pretty sure my blog ID did not change during my sleep.</p>

<p>So I started digging around, and I found that the OAuth authentication token returned says <strong>I'm not actually logged in Google</strong>. In the <code>status</code> object from the token, the <code>signed_in</code> property is true but the <code>google_logged_in</code> one is false. Yet the Google login page showed up correctly upon execution and I allowed it, and the token does not have an error property. Why does it says I'm not logged in?</p>

<p>I'm under the assumption that Google blocked my application from making new requests due repeated use (even thought I never reached a dent of the daily quota) and now since the OAuth 2 ID authentication does not work, the API tries to use only the web browser API key, which does not work either since it's a private blog and user permission is required. But I really don't know.</p>

<p>I could not find a similar situation on the internet. I tried deleting both my API and OAuth keys and making new ones, deleting the project from the Google Console Developers and creating a new one under a different account, removing the application from the "allowed apps" in my account and adding it again, not using the browser API key. No game.</p>

<p>I would appreciate any inputs in solving this issue. And before anyone suggests: the "conventional" way of creating an automated index using the blog's feed does not work in my case, since the blog is private and has no feed.</p>

<p>Bellow is the returned access token (redacted a bit):</p>

<pre class="lang-json prettyprint-override"><code>{
 _aa: "1"
 access_token: "[Redacted]"
 client_id: "[Redacted]"
 cookie_policy: undefined
 expires_at: "1460999668"
 expires_in: "3600"
 g_user_cookie_policy: undefined
 issued_at: "1460996068"
 response_type: "token"
 scope: "https://www.googleapis.com/auth/blogger.readonly"
 state: ""
 status: {
  google_logged_in: false
  method: "AUTO"
  signed_in: true
 }
 token_type: "Bearer"
}
</code></pre>

<p>And bellow an example code of my application:</p>

<pre class="lang-js prettyprint-override"><code>var apiKey   = "myWebBrowserApiKey";
var clientId = "myOAuth2ClientID";
var blogId   = "myBlogID";
var bloggerReadOnly = "https://www.googleapis.com/auth/blogger.readonly";

var fetchParam = {
    blogId:      blogId,
    fetchBodies: false,
    fetchImages: false,
    maxResults:  500,
    status:      "live",
    view:        "READER"
};

var authParamIm = {
    client_id: clientId,
    scope:     bloggerReadOnly,
    immediate: true
};

var authParam = {
    client_id: clientId,
    scope:     bloggerReadOnly,
    immediate: false
};

//Executed as soon the client:blogger.js loads
function handleClientLoad() {
    gapi.client.setApiKey(apiKey);
    window.setTimeout(checkAuth,1);
}

//Check if the user is already authenticated for immediate access
function checkAuth() {
    gapi.auth.authorize( authParamIm, handleAuthResult );
}

function handleAuthResult(authResult) {

    //If the user does already have authorization, proceed with the API call
    if (authResult &amp;&amp; !authResult.error) {
        makeApiCall();
    }

    //If he does not, shows the authorization button
    else {
        authorizeButton.css('visibility', 'visible');
        authorizeButton.click(handleAuthClick);
    }
}

//The authorization button calls this function, that shows a Google login page
function handleAuthClick(event) {
    gapi.auth.authorize( authParam, handleAuthResult );
    return false;
}

//Loads the Blogger API, version 3, and runs the fetchPosts() function with a callback
function makeApiCall(){
    gapi.client.load('blogger', 'v3', fetchPosts);
}

function fetchPosts(){

    //Creates a request to get a list of posts from the blog, using the fetch parameters
    var request = gapi.client.blogger.posts.list(fetchParam);

    //Execute the request and treats the response with a callback function
    request.execute(function(response){
        //Do Stuff
    }
}
</code></pre>