2020-07-01 UPDATE:
You can find updated and modern information documented in the "Authenticating with Plex" forum topic. We strongly recommend using that method instead now.
Deprecated Information:
Every client must request its own X-Plex-Token and register with plex.tv. This requires a valid Plex account username and password.
Do a HTTP POST request to https://plex.tv/users/sign_in.json (or https://plex.tv/users/sign_in.xml) with:
- user[login] and user[password] form values in the body. For example: user%5Blogin%5D=plexusername&user%5Bpassword%5D=myplexpassword
- HTTP header: X-Plex-Client-Identifier: a unique value for your client
- HTTP header: X-Plex-Product: the name of your client
- HTTP header: X-Plex-Version: the version of your client
Upon success you will get back a JSON (or XML) formatted response that contains a token you can use with other requests to the Plex Media Server. This token must be sent as a HTTP header (X-Plex-Token).
Your registered client will be listed under "Devices" (see attachment).
(Edit: Updated recommended method from using Basic Auth to passing the 'user[login]' and 'user[password]' parameters.)