0

i try to decode integrity token refer from below link

https://developer.android.com/google/play/integrity/verdict#decrypt-verify-google-servers

it leads me to google-client-api and with help of that i build following code and run it

$path = storage_path() . "/credentials.json";
$client = new Client();
$client->setAuthConfig($path);
$client->addScope(PlayIntegrity::PLAYINTEGRITY);
$service = new PlayIntegrity($client);
$tokenRequest = new DecodeIntegrityTokenRequest();
$tokenRequest->setIntegrityToken($token);
$result = $service->v1->decodeIntegrityToken($packageName, $tokenRequest);

then it shows error of require oAuth2.0 verification token like given below

{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "errors": [ { "message": "Login Required.", "domain": "global", "reason": "required", "location": "Authorization", "locationType": "header" } ], "status": "UNAUTHENTICATED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "method": "google.play.integrity.v1.DecodeIntegrityTokenService.DecodeIntegrityToken", "service": "playintegrity.googleapis.com" } } ] } }

then i try to get OAuth 2 access token with the help of client id and client secret in postman as below

enter image description here

I also set origin point and end point in credentials page shown below

enter image description here

is not working oauth2.0 it shows invalid scope to get access token.

i also try to get aceess token by code like below

$client = new Google\Client(); 
$client->setAuthConfig('/path/to/client_credentials.json');
$client->addScope(Google\Service\Drive::DRIVE);
also add client id and secret
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $client->setRedirectUri($redirect_uri);
call this request

in redirected url

if (isset($_GET['code'])) {
    $token = $client->fetchAccessTokenWithAuthCode($_GET['code']);
}

nothing works

PLEASE HELP ME IF ANYONE FOUND SOLUTION FOR THIS

i try to decode integrity token at php server and it deadened at Error 400: invalid_scope when i requesting access token to fetch oauth2.0 verification

Vijay
  • 571
  • 4
  • 4

0 Answers0