cglatot/pasta

Support Managed Users

cglatot opened this issue · 13 comments

Is your feature request related to a problem? Please describe.
Support Managed Users within plex. Some details: https://www.reddit.com/r/PleX/comments/jjljpo/tired_of_changing_audio_and_subtitle_tracks_for/gadilyi/

In order to sign in as a Managed user from the admin's account you will need the user's accessToken. All shared users' accessToken can be viewed from https://plex.tv/api/servers/{machineId}/shared_servers?X-Plex-Token={ADMIN_TOKEN}. With the accessToken from the user you can sign in to the server as the user. From there you can do what you want. Hope that helps.

In order to sign in as a Managed user from the admin's account you will need the user's accessToken. All shared users' accessToken can be viewed from https://plex.tv/api/servers/{machineId}/shared_servers?X-Plex-Token={ADMIN_TOKEN}. With the accessToken from the user you can sign in to the server as the user. From there you can do what you want. Hope that helps.

This API endpoint only seems to give who the server was shared with - it does not include the managed accounts if those accounts are owned by the server admin (it doesn't even show the admin account here).

@cglatot

@blacktwin is correct here, since it'll return users it's shared with, but problem here is that you doesn't see the users name :(

So when gathering a list of all the users, with a blank username or email, you can look at their id
Then compare that with the list you can get from https://plex.tv/api/users, and the managed users name is in the title field

any progress on this? this tool is amazing for single-user changes (usually just the admin), but it would be even better if I could change all audio and subtitle default preferences for all users in one fell swoop.

This would be a useful feature to implement. In the meantime, blacktwin's accessToken workaround is what I'm using for my one managed user. I can see how it would be difficult for others with more managed users as you would have to further dig into their userID to figure out whose settings you're changing.

This would be a useful feature to implement. In the meantime, blacktwin's accessToken workaround is what I'm using for my one managed user. I can see how it would be difficult for others with more managed users as you would have to further dig into their userID to figure out whose settings you're changing.

@vtruong68, Would you mind ELI5 on how you got this to work? It's my understanding managed users don't get tokens. I've tried using the link above and incorporating my machine ID and admin plex token, but I get a 404 error for https://plex.tv/api/servers/{machineId}/shared_servers?X-Plex-Token={ADMIN_TOKEN}

Thanks!

@twinkie0101

A 404 error sounds to me more like you aren't even hitting the Plex API and maybe typed something in wrong. I copy and pasted your link and it works fine for me. Are you excluding the curly brackets "{ }"?

I grabbed my machine ID by navigating to a specific episode or movie in Plex. https://app.plex.tv/desktop/#!/server/{machineID}/details?key=...
For the admin token, I followed the following instructions while logged in as my admin user: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/

Plugged those in to https://plex.tv/api/servers/{machineId}/shared_servers?X-Plex-Token={ADMIN_TOKEN} and got an XML with the user accessToken information.

Thanks for your response. I've got my token and deleting the { } in my url. I am wondering if I am using the appropriate machine ID. I used tautulli to get that info plex server url. My machine ID is ipaddress with - instead of . (e.g. XXX-XXX-XX-X) followed by a string of characters (and see the same info viewing the XML data). So my url looks something like this:

https://plex.tv/api/servers/XXX-XXX-XX-XX.string of alphnumeric characters.plex.direct:32400/shared_servers?X-Plex-Token=XXXXXXXXXXXXX

But keep getting the 404 error.

Hey guys, this feature would be a really big deal for me. I'd been blithely updating the settings for my media, and was shocked when my friends reported that audio/subtitles never worked right

Personally, I'd like to see users handled like so:
image

And then from that point onwards it all works the exact same.

I only really have experience with programming for embedded applications, so let me know if there's some way I can help. I'm also prepared to put a money bounty on this if that helps (I can barely code) as this is such a massive deal for me.

Hey guys, this feature would be a really big deal for me. I'd been blithely updating the settings for my media, and was shocked when my friends reported that audio/subtitles never worked right

Personally, I'd like to see users handled like so:

And then from that point onwards it all works the exact same.

I only really have experience with programming for embedded applications, so let me know if there's some way I can help. I'm also prepared to put a money bounty on this if that helps (I can barely code) as this is such a massive deal for me.

If your friends and family are using their own accounts (I.E. Not "managed accounts") then this is impossible. They would need to login with their own account details and do it themselves.

If they are all Managed Accounts, then this is what this issue will hopefully solve when I get some time to properly look at it agian.

any updates or temporary solutions that work for managed users?

Unfortunately no, I haven't had time at all for PASTA for the past while.

I did see this workaround someone posted on Reddit, however: https://www.reddit.com/r/PleX/comments/u1qos5/anyone_know_if_using_pastatool_affects_other/i4e3x4t/

I haven't tried it myself just yet - but I have it saved for reference material when I can eventually get around to trying to solve this in-app.

If your friends and family are using their own accounts (I.E. Not "[managed accounts](https://support.plex.tv/articles/203948776-managed-users/)") then this is impossible

Actually, as a server owner, you can get the access token your users use to logon to your server.
Then use that to logon, and set the things needed