Google Groups

Re: [oauth2-dev] Re: 401 error with message": "This developer account does not own the application."


oferabra Jun 30, 2012 11:45 PM
Posted in group: Developer Forum for Google API Access using OAuth2
Hey,

as i understand the use of the publisher api is only with server side (no client actions are involved).
as explained I opened project in Google console got private key file & email account .
since no offical sample code was publihsed I used this example of storageService .
as I understand it's the same flow, i got the access token then sends the get request and as a response i get the "This developer account does not own the application.".
if no access token is generated i get different error "401 not authorized" or something similar.
if any official example be published I think it will be best for all.

thanks


On Saturday, June 30, 2012 1:00:42 AM UTC+3, Naveen Agarwal wrote:


Based on my quick reading of the androidpublisher api auth doc

It says "Access to the Google Play Android Developer API is authenticated using the OAuth 2.0 Web Server flow. Before you can use the API, you will need to set up an APIs Console project, create a client ID and generate a refresh token."

From the code you posted, you are trying to use a service account but the API is for a real user account.

So you need to manually get an access token using the web server flow and try the API.

It may be easier if you describe the overall flow and what you are trying to do (what is client doing, if ther eis a server involved) and we may be able to help more.

Thanks

Naveen

On Fri, Jun 29, 2012 at 7:26 AM, Emmanuel Costa <fac...@gmail.com> wrote:
Same problem, after a quick search a lot seems to encounter this problem.

Still no response from Google ?

Le vendredi 29 juin 2012 09:31:33 UTC+2, Asif Tasleem a écrit :
I am receiving the same issue. My code seems like this:

 GoogleCredential credential =
            new GoogleCredential.Builder().setTransport(HTTP_TRANSPORT)
                .setJsonFactory(JSON_FACTORY)
                .setServiceAccountId(SERVICE_ACCOUNT_EMAIL)
                .setServiceAccountScopes("https://www.googleapis.com/auth/androidpublisher")
                .setServiceAccountPrivateKeyFromP12File(new File("key.p12"))

                .build();

        credential.refreshToken();

        Androidpublisher pub =
            new Androidpublisher.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
                .setApplicationName("xxxxxxxxx").build();

        SubscriptionPurchase purchse =
            pub.purchases()
                .get("xxx.xxxxxx", "xxx.xxxx.test.xxxx", "xxxxxxxxxxxxxxxxxxxxx")
                .execute();

On Friday, 22 June 2012 20:03:03 UTC+5, Milan Cermak wrote:
Although my code is in Python, I have the same problem. I would really appreciate if someone from Google would fix it as it's a blocker for our upcoming application.

On Tuesday, June 19, 2012 3:08:46 PM UTC+2, oferabra wrote:
Hi,

I've implemented in my app the new subscription option,i'm trying to use the account services to get user expiration date from google servers.
i have managed to get the access token,but when i send the get request i get 
  "code": 401,
  "message": "This developer account does not own the application."

although this is my developer account.

code:

credential=
new GoogleCredential.Builder().setTransport(netHttpTransport)
.setJsonFactory(jacksonFactory)
.setServiceAccountId(xxxxxxxxxxxxxxxxx@developer.gserviceaccount.com)  //from api console
.setServiceAccountPrivateKeyFromP12File(file)
.build();
credential.refreshToken();

String uri ="https://www.googleapis.com/androidpublisher/v1/applications/"+packageName+"/subscriptions/"+subscriptionId+"/purchases/"+PurhcaseToken;
GenericUrl url = new GenericUrl(uri);
HttpRequestFactory requestFactory =netHttpTransport.createRequestFactory(credential);
HttpRequest request = requestFactory.buildGetRequest(url);
HttpResponse response = request.execute();


--
You received this message because you are subscribed to the Google Groups "oauth2-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/oauth2-dev/-/mi6Rbevnd38J.

To post to this group, send email to oauth...@googlegroups.com.
To unsubscribe from this group, send email to oauth2-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/oauth2-dev?hl=en.