Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Trakt ID/Secret/PIN in config #845

Open
bakes82 opened this issue Mar 24, 2022 · 16 comments
Open

Feature request: Trakt ID/Secret/PIN in config #845

bakes82 opened this issue Mar 24, 2022 · 16 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bakes82
Copy link

bakes82 commented Mar 24, 2022

Ability to set the trakt ID/Secret/PIN in the config so you can run in dockers where you dont get SSH access.

Run 1 - Trakt ClientID/Secret in config

  • Script will error not authed - put auth URL in log.
    Run 2 - Add PIN to config
  • Script removes pin once authed its 1x so not a big deal if not
@bakes82 bakes82 added the enhancement New feature or request label Mar 24, 2022
@bakes82
Copy link
Author

bakes82 commented Mar 24, 2022

@glensc You think you can pop this in, would be huge improvement for remote hosting and what not.

@glensc
Copy link
Collaborator

glensc commented Mar 24, 2022

@bakes82 I don't even understand what are you talking about here, even its English words. you assume too much I know about your workflow. you need to describe what are you doing (as precisely as possible, and reproducible) and what you expect to happen (as precisely as possible). also you totally discarded issue template which we made so that people fill necessary details and don't create issues like you made now.

@simonc56
Copy link
Collaborator

He wants unattended install.
Same problem for Plex, right ?

@simonc56
Copy link
Collaborator

Workaround is to do the first run on another computer where you have console access to perform the interactive setup.
Then copy .env and .pytrakt.json files (contains plex & trakt auth tokens) to the remote computer.

@bakes82
Copy link
Author

bakes82 commented Mar 24, 2022

Correct, the current process doesnt work for dockers where you dont have shell access. I dont want to install python and run a bunch of crap just to "auth" an app when I can generate the authorized pin before hand and just pass it as a config option.

Plex Meta Manager just implemented it per request so Im asking for the same thing here .

REF Code
Kometa-Team/Kometa@2c60255

Navigate to https://trakt.tv/oauth/authorize?response_type=code&redirect_uri=urn:ietf:wg:oauth:2.0:oob&client_id=<<CLIENT_ID>> replacing <<CLIENT_ID>> with your Client ID.
7. Record the PIN as pin in your Configuration File.

@glensc glensc added the docs needed Changes in this issue/pull request need to be documented label Mar 25, 2022
@glensc
Copy link
Collaborator

glensc commented Mar 25, 2022

as @twolaw said, run the process elsewhere and copy the files. adding "docs needed" label, so documentation update pr for this is wanted.

@bakes82
Copy link
Author

bakes82 commented Mar 25, 2022

This doesnt fix the issue when I cant upload files to my docker host, I can only edit the one file they expose to me.

@glensc
Copy link
Collaborator

glensc commented Mar 26, 2022

@bakes82
Copy link
Author

bakes82 commented Mar 28, 2022

Im not sure what you dont understand. This isnt a documentation issue, this is a feature request to allow authing via pin from the config. Not sure why you are telling me work arounds, thats not what Im looking for, I know of them already. My users dont use python, we want to put this as part of a docker image with other things, and only expose the config file for them to edit. They cant ssh, they cant upload files, they get a webpage with the ability to edit the config file.
Unless we could store the json thats in the other two files as elements in the config and then if they arent null they are written to the other two files or what not. Its not as easy a pin auth but maybe its easier? Again not sure the PMM people thought was a fine idea to do pin auth so not sure what your hang up about it is. Its something that solves problems when you cant run in interactive mode and then you dont need to run it on another machine, kind of defeats the point of remote hosting.

@glensc
Copy link
Collaborator

glensc commented Mar 28, 2022

responding to the wall of text without reading it: pin auth is interactive. you can't do that with filling files, as to fill file you need to restart the process and if you restart the process the pin auth session is aborted.

it's an accepted solution to do authentication elsewhere and then copy the session files to the other instance.

adding "docs needed" label, so someone can contribute documenting the process it to readme.md.

@simonc56
Copy link
Collaborator

simonc56 commented Mar 28, 2022

Pin auth is not officially supported anymore.
The device auth workflow (used in PlexTraktSync) is to enter a locally generated code on https://trakt.tv/activate before the 10min expiration time.

A solution can be an opt-in to make the script write this code in a file and remember the device_code. Then the user would have to read this file and enter the code on the activate webpage then relaunch the script within 10 mins. Quite complicated.

image

@bakes82
Copy link
Author

bakes82 commented Mar 28, 2022

When I say "pin" Im meaning the auth code from the activate url. You can get this "code/pin" before the code runs since you know the URL and your clientid, this code remains valid for 1 login attempt (possible 10min limit ive never gone beyond 1min). So a user can go to it before even running the app, copy it, put it in the config, and then run the app, at which point you could use it to login and generate the other two files you need as normal. Honestly it not any more complicated then making an api in trakt lol than you need to copy it in to the config file, plus it can all be done at the same time before it runs as you put in the id/secret. Pin would be optional for non interactive mode.

Youre all about people reading the doc, so just like they did you add this for optional non interactive mode:
Navigate to https://trakt.tv/oauth/authorize?response_type=code&redirect_uri=urn:ietf:wg:oauth:2.0:oob&client_id=<<CLIENT_ID>> replacing <<CLIENT_ID>> with your Client ID. Record the PIN as pin in your Configuration File.

@bakes82
Copy link
Author

bakes82 commented Apr 1, 2022

@twolaw Just to follow up on this I was doing the new PMM pin auth process, Track calls the device auth code a "PIN"
image

Also the process of authing a device is actually built in to the trakt ui screen when you make a new api you press the magic authorize button, so the process is even simpler lol
image

@simonc56
Copy link
Collaborator

simonc56 commented Apr 1, 2022

You're right, the workflow is easy with this Authorize button in web UI.
But it invokes the pin auth method which is not officially supported (and not recommended) anymore.

I'll see if this very specific use case can be added without creating a mess in the setup process for the average user. We want to keep the readme as simple as possible.

@glensc
Copy link
Collaborator

glensc commented Nov 20, 2022

plex-login has --password="$PLEX_PASSWORD" command line argument.

@glensc
Copy link
Collaborator

glensc commented Nov 20, 2022

similar --client-id and --client-secret could be added to trakt-login:

@glensc glensc added help wanted Extra attention is needed and removed docs needed Changes in this issue/pull request need to be documented labels Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants