DarkCat09 / python-aternos

[UNMAINTAINED] Unofficial Aternos API written in Python
https://pypi.org/project/python-aternos/
Apache License 2.0
91 stars 13 forks source link

Add support for Google Login #19

Open flancast90 opened 2 years ago

flancast90 commented 2 years ago

As the title implies, an auth flow using Google would be beneficial for google-using clients.

DarkCat09 commented 2 years ago

Hello.
It's too hard or impossible because of OAuth security.

DarkCat09 commented 2 years ago

I'll appreciate if you help me with this feature.

flancast90 commented 2 years ago

Hello. It's too hard or impossible because of OAuth security.

Not really. Google App Passwords allow a simple username/password login without disabling the Secure Apps features. I think the hard part will be determining the token Aternos uses for the Google Login. However, if they keep you logged in, you could attempt a normal OAuth flow, and then see if it's persistent across Aternos.

DarkCat09 commented 2 years ago

determining the token Aternos uses for the Google Login

Aternos' backend is not open-source.
It doesn't provide any ajax API for logging in with Google.

While the feature is not implemented, use Client.from_session specifying ATERNOS_SESSION cookie as an argument.

flancast90 commented 2 years ago

Aternos' backend is not open-source. It doesn't provide any ajax API for logging in with Google.

Yes, but the args are passed to Google via URL to open the google signin window. If you could determine the token for Google signin, you could use the standard Google OAuth library without any need for Aternos' backend.

TheRedstoneRadiant commented 1 year ago

Google Sign-in Button href: https://aternos.org/auth/google-login

Redirects to https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?response_type=code&access_type=online&client_id=853067141497-24lhsecgk8lm86qat7nolobpn791o2r6.apps.googleusercontent.com&redirect_uri=https://aternos.org/auth/google-login&state=...&scope=https://www.googleapis.com/auth/userinfo.email&approval_prompt=force&flowName=GeneralOAuthFlow

client_id=853067141497-24lhsecgk8lm86qat7nolobpn791o2r6.apps.googleusercontent.com redirect_uri=https://aternos.org/auth/google-login