imLinguin / nile

Unofficial Amazon Games client
GNU General Public License v3.0
306 stars 16 forks source link

Non-interactive login support #27

Closed Gustash closed 1 year ago

Gustash commented 1 year ago

This issue is in relation to the Heroic Games Launcher integration.

Why

Currently, the cli can only login through user interaction.

In theory we could make it work for Heroic, but it would require a lot of work and be finicky. For example, we would need to parse the URL from all the instructions, find a hacky way to stop the tool from opening a separate browser for login, and keep a child process around until login completion.

Proposal

What I propose is a two step solution:

Issues to be addressed

I've already been toying around with these proposals. The only issue right now is that we're storing the code_verifier in the class instance, so we'd need to send whatever data is required to finish login with --skip-instructions.

Discussion

If these proposals sounds, well, sound, my question is on what the output format for --skip-instructions should be. Just newline separated, positional, output? Maybe JSON would be easier to parse? Add support for both through a flag?

I'd like to have a discussion over this before contributing something, to make sure we all agree on implementation details.

imLinguin commented 1 year ago

Since we need things like serial client_id etc.later on I beliebe --skip-instructions should contain everything we need alonside with generated url.

Then we can add a flag or another subcommand which would expect those parameters with authorization code (we can separate the code from the url in Heroic itself).

imLinguin commented 1 year ago

Take a look at https://github.com/imLinguin/nile/blob/main/nile/api/authorization.py#L73 to see what parameters are needed.