1
votes

We are upgrading our OAuth1 Google Apps marketplace app to OAuth2 On upgrade old app is uninstalled, new app is installed but data access is not granted automatically

Old app scopes:

https://apps-apis.google.com/a/feeds/user/#readonly # provisioning API

New app scopes:

https://www.googleapis.com/auth/userinfo.email  
https://www.googleapis.com/auth/userinfo.profile    
https://www.googleapis.com/auth/admin.directory.user.readonly # directory_v1 API
https://www.googleapis.com/auth/appsmarketplace.license

I don't understand were is the problem. AFAIK In old OAuth1 apps userinfo and LicensingAPI access was enabled automatically. ProvisioningAPI and Directory_v1 scopes match. What we should change to grant data access automatically on upgrade.

1

1 Answers

1
votes

The scope https://www.googleapis.com/auth/appsmarketplace.license counts as a new scope, and prevents the authorization from being transferred during the upgrade. Instead of asking the admin of the domain to grant access to this scope, grant access to this API once as the developer of the application and use that token to access this API for all customers.