Search code examples
oauthgoogle-data-apigoogle-apps-marketplace

App to work with Google Apps Marketplace and Google Account


How do I get my application to work with the Google APIs for both Google Apps Marketplace and non-Apps Google Account users using OpenID and Oauth? (AuthSub is no longer supported by Google Apps)

Error I have experienced:

Token invalid - Invalid token: ACL not found for domain: 358xxxxxxxxx and consumer: 736xxxxxxxxx

Solution:

I had to learn to wrap my head around Google Marketplace. I created 3 apps (dev/localhost, staging, live) and reference the necessary keys. This error was because I was using the wrong key with the domain.


Solution

  • Your OAUTH consumer key and secret will only work for Google Apps domains combined with 2-legged OAUTH. That is because - at installation time - the domain administrator of the GAPPS domain authorizes your consumer key and secret for all users within his GAPPS domain.

    If you want to ordinary Google accounts to work, then you need to use 3-Legged OAUTH and individual users need to authorize access to their data for your application. This means you have to initiate an authorization flow and store token and token secret per individual user and use these tokens each time you want to access an individual's data.