HI, I’m trying to make a remote controller for in my local network. I want everybody to login in their own account. On my account where the server is linked to it is working. Only with guest user (shared lib users) It doesn’t work. I think it is because I need to get a transient token.
How can I get transient token from the server?
I’m trying to build an app right now and have just hit this wall as well. I can’t seem to pull any library sections from a guest account. Have you had any luck solving the problem?
I just figured this out for PlexPy last week.
- Grab the guest’s Plex access token from POST
https://plex.tv/users/sign_in.xml
. (I assume you already have this part). - Use the Plex access token from step 1 to GET
https://plex.tv/pms/servers.xml?X-Plex-Token=<guest_token>
- The guest’s server access token will be in the
<Server>
XML tag. - Use the server access token from step 3 to access the libraries (
/library/sections
etc.)
Note: The owner of the PMS will have the same Plex access token, and server access token.
Thank you so much. I’ve spent hours trying to figure this out. I was just missing those final two steps.
@JonnyWong16 said:
I just figured this out for PlexPy last week.
- Grab the guest’s Plex access token from POST
https://plex.tv/users/sign_in.xml
. (I assume you already have this part).
Would you mind to share the whole http header you used to retrieve that token ? as I have only failure for it (hide login/pass from it !
@vincen said:
@JonnyWong16 said:
I just figured this out for PlexPy last week.
- Grab the guest’s Plex access token from POST
https://plex.tv/users/sign_in.xml
. (I assume you already have this part).Would you mind to share the whole http header you used to retrieve that token ? as I have only failure for it
(hide login/pass from it !
Just take a look at PlexPy.
@JonnyWong16 said:
@vincen said:
@JonnyWong16 said:
I just figured this out for PlexPy last week.
- Grab the guest’s Plex access token from POST
https://plex.tv/users/sign_in.xml
. (I assume you already have this part).Would you mind to share the whole http header you used to retrieve that token ? as I have only failure for it
(hide login/pass from it !
Just take a look at PlexPy.
Tautulli/plexpy/plextv.py at master · Tautulli/Tautulli · GitHub
Thanks for link but unhappy I’m not really familiar with Python so not easy to guess what exact whole syntax you used to do the request on plex.tv server
A copy/paste of the whole string sent by your module ? (hide the base64encoded part)
@vincen said:
@JonnyWong16 said:
@vincen said:
@JonnyWong16 said:
I just figured this out for PlexPy last week.
- Grab the guest’s Plex access token from POST
https://plex.tv/users/sign_in.xml
. (I assume you already have this part).Would you mind to share the whole http header you used to retrieve that token ? as I have only failure for it
(hide login/pass from it !
Just take a look at PlexPy.
Tautulli/plexpy/plextv.py at master · Tautulli/Tautulli · GitHubThanks for link but unhappy I’m not really familiar with Python so not easy to guess what exact whole syntax you used to do the request on plex.tv server
A copy/paste of the whole string sent by your module ? (hide the base64encoded part)
The headers are listed 3 lines below the line that I linked to.
@JonnyWong16 said:
The headers are listed 3 lines below the line that I linked to.
So it should be formatted this way right ?
GET /users/sign_in.xml HTTP/1.1 Content-Type: application/xml; charset=utf-8,X-Plex-Device-Name: PlexPy,X-Plex-Product: PlexPy,X-Plex-Version: plexpy.common.1,X-Plex-Platform: plexpy.common.Linux,X-Plex-Platform-Version: plexpy.common.2,X-Plex-Client-Identifier: plexpy.iec,Authorization: Basic xxxxxxxx=
xxxxx being my login:password of my plex account in Base64 right ?
I get that as answer
HTTP/1.1 400 BAD_REQUEST Content-Length: 0 Connection: Close
@vincen said:
@JonnyWong16 said:
The headers are listed 3 lines below the line that I linked to.So it should be formatted this way right ?
GET /users/sign_in.xml HTTP/1.1 Content-Type: application/xml; charset=utf-8,X-Plex-Device-Name: PlexPy,X-Plex-Product: PlexPy,X-Plex-Version: plexpy.common.1,X-Plex-Platform: plexpy.common.Linux,X-Plex-Platform-Version: plexpy.common.2,X-Plex-Client-Identifier: plexpy.iec,Authorization: Basic xxxxxxxx=
xxxxx being my login:password of my plex account in Base64 right ?
I get that as answer
HTTP/1.1 400 BAD_REQUEST Content-Length: 0 Connection: Close
You need to substitute all the
plexpy.common.xxxxx
plexpy.CONFIG.xxxxx
with your own values from your application. And it’s a POST
request for signing in.
@JonnyWong16 said:
You need to substitute all theplexpy.common.xxxxx plexpy.CONFIG.xxxxx
with your own values from your application. And it’s a
POST
request for signing in.
Tautulli/plexpy/plextv.py at master · Tautulli/Tautulli · GitHub
Replaced GET by POST but still same error I’m aware I need to update all the plexpy string by my own but I guess it’s not a problem for the tests of my syntax right ?
@vincen said:
@JonnyWong16 said:
You need to substitute all theplexpy.common.xxxxx plexpy.CONFIG.xxxxx
with your own values from your application. And it’s a
POST
request for signing in.
Tautulli/plexpy/plextv.py at master · Tautulli/Tautulli · GitHubReplaced GET by POST but still same error
I’m aware I need to update all the plexpy string by my own but I guess it’s not a problem for the tests of my syntax right ?
Works perfectly fine
@JonnyWong16 said:
@vincen said:
@JonnyWong16 said:
Works perfectly fine
What is that tool you used ?