kagasu / GooglePlayStoreApi

Google Play Store API for .NET(unofficial)
MIT License
20 stars 6 forks source link

Getting Forbidden 403 Error When Try Get Token #5

Closed rezionline closed 4 years ago

rezionline commented 4 years ago

Hi, When i try to get token from 'https://android.clients.google.com' with correct user name and password server return 403 Error.

I am use link below code : https://github.com/kagasu/GooglePlayStoreApi/blob/master/GooglePlayStoreApi/GooglePlayStoreClient.cs

This problem happened two days ago. Where is the problem and how can it be resolved?

kagasu commented 4 years ago

Everything similar to this project was died at same time. this mean, google decided reject old API, i think.

so, we have to re-implement new GetGoogleToken API.

rezionline commented 4 years ago

What alternative should we use now? And where can I access to new Google Play APIs?

kagasu commented 4 years ago

I'm released new version 1.0.3 now. Please check again README.md

rezionline commented 4 years ago

Thank you, but there is no better way to do it more professionally and automatically like before?

kagasu commented 4 years ago

We have to get auth_token from website at first time. That website is complex, so i don't want to implement it. If you want automatically get auth_token, write code your way using like Headless Chrome.

Also, GoogleToken looks like doesn't have expiry. It is reusable.

First login

var token = "oauth2_4/...";
token = await client.GetGoogleToken(token);
// save token to "token.txt"
File.WriteAllText("token.txt", token);
await client.GetGoogleAuth(token);

Second login

// load token from "token.txt"
var token = File.ReadAllText("token.txt");
await client.GetGoogleAuth(token);
hoffie commented 4 years ago

You may gain further insight from the analyses in this issue: https://github.com/NoMore201/googleplay-api/issues/98