sbm-eval / Secret_Breach-Survey

0 stars 0 forks source link

raj_07 #261

Open shahriar-raj opened 1 month ago

shahriar-raj commented 1 month ago

This may be the wrong place to post this, but I'm having difficulty reaching anyone familiar with google apis on either android-developers or google-apis-explorer-users forums.

I'm having a problem deciphering the root cause of a cryptic "invalid value" response for the androidpublisher.inapppurchases.get api. OAuth is working fine, and I'm able to get the access_token as well as refresh_token.

I'm guessing something in the parameters are malformed or missing but cannot decipher where. The dev console project seems to be connected correctly because for an unauthorized user, querying on my packageName throws a permission denied error.

I also suspected the productId may be malformed, and I tried all sorts of combinations such as subs:{packageName}:pro_monthly_15, {packageName}:pro_monthly_15, etc. with all the same invalid response.

Can anyone help me shed some light on this?

oauth2Client.credentials = {
            access_token: '{removed}',
            refresh_token: '{removed}'
        };

        googleapis
            .discover('androidpublisher', 'v1.1')
            .execute(function(err, client) {

                console.log(['discovered', err, client.androidpublisher.apiMeta]);

            var params = {
                packageName: '{removed}',
                productId:   'pro_monthly_15',
                token:       'glhannifclifbhdgbpalegib.AO-J1OyeEpe0JagpGtG588_Jor3mtqjp_CRB-xGdq55kqMMWqGyGd2YlesHdazWPnOC4CoB0EVP-o_j1LT7taDJE8vUxg7UcjzeMPZ4WHi79aTYdv3FalrvqKAFTvWZqJqwjecdGaTpa'
            };
            client
                .androidpublisher.inapppurchases.get(params)
                .withAuthClient(oauth2Client)
                .execute(function (err, response) {
                    console.log([err, response]);

                    res.json({
                        response: response,
                        error: err
                    });
            });
        });

Cryptic response:

{
  "response": null,
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalid",
        "message": "Invalid Value"
      }
    ],
    "code": 400,
    "message": "Invalid Value"
  }
}

7.txt You're currently signed in as shahriarraj121@gmail.com shahriar raj Displaying 7.txt.