ekosz/Plex-Ruby — pull request #11 by philduffy (2014-01-31 19:32:21+00:00)
Title: Add X-Plex-Token support to requests for remote calls

Hey guys,

I've had a fun couple of days figuring this out and working on this. So what happens is locally calls work fine, because Plex Media Server does not require authentication on a LAN. However, I'm trying to access data about my home PMS from Heroku. One option would be to pay for a static IP and whitelist the IP for authentication in the settings on PMS. Alternately, after a lot research (and I could not find much documentation on this) I found that if you append X-Plex-Token=AUTH_CODE to all requests PMS will authenticate.

Before merging in this would require some added documentation (such as how to get this code). I was able to get it by doing:

`curl -H "Content-Length: 0" -H "X-Plex-Client-Identifier: my-app" -u: -X POST https://my.plexapp.com/users/sign_in.xml
`

I have this working just fine on my personal site now via heroku command line, and I figured I would see if you guys wanted to merge it in upstream. Honestly this is my first time doing something this extensive with someone else's gem so let me know if I need to do anything else!