# Need Help Getting A Plex Token For Access

**URL:** <https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973>\
**Category:** General Discussions\
**Created:** [March 23, 2019, 12:00am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973 "2019-03-23T00:00:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wormuth\_Family](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Wormuth\_Family](https://forums.plex.tv/u/Wormuth_Family)\
**Post date:** [March 23, 2019, 12:00am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/1 "2019-03-23T00:00:52Z")

</div>

I need help getting a token to access my server.

I use Linux on everything, and I have Home Assistant running fine. It wants to set up Plex, but I need a token for it. Can someone tell me what I need to type into the terminal to return a token I can use. I just need one permanent token for this application to remotely access my server, but it is pretty confusing from all the stuff I’ve read.

It seems like this should be a button on the devices page of your account, but I digress.

Thanks!!

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [March 23, 2019, 12:01am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/2 "2019-03-23T00:01:59Z")

</div>

[https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/)

---

<div class="post-metadata">

**Author:** ![Wormuth\_Family](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Wormuth\_Family](https://forums.plex.tv/u/Wormuth_Family)\
**Post date:** [March 23, 2019, 12:06am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/3 "2019-03-23T00:06:40Z")

</div>

Right. Now how do I…

"Do a HTTP POST request to [https://plex.tv/users/sign\_in.json](https://plex.tv/users/sign_in.json) (or [https://plex.tv/users/sign\_in.xml](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"

We need the english example, not the code instructions for developers. Any help would be great.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [March 23, 2019, 12:08am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/4 "2019-03-23T00:08:46Z")

</div>

You only need to read the first paragraph, because this is all you need to get a token.

---

<div class="post-metadata">

**Author:** ![Wormuth\_Family](https://avatars.discourse-cdn.com/v4/letter/w/71e660/32.png) [@Wormuth\_Family](https://forums.plex.tv/u/Wormuth_Family)\
**Post date:** [April 21, 2019, 3:42am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/5 "2019-04-21T03:42:06Z")

</div>

I’m not getting this…

If I’m in a terminal on Linux, what would I type?

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [April 21, 2019, 3:55am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/6 "2019-04-21T03:55:31Z")

</div>

You can’t get it in a terminal, AFAIK.

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [April 21, 2019, 7:58am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/7 "2019-04-21T07:58:51Z")

</div>

Actually, you can 😉

```auto
#!/bin/sh

read -p 'plex.tv Username: ' uservar
echo ''
read -sp 'plex.tv Password: ' passvar

url="https://plex.tv/api/v2/users/signin?login=$uservar&password=$passvar&X-Plex-Client-Identifier=12345abcDEF"
response=$(curl -X POST -i -k -L -s $url)
# Grap the token
UserToken=$(printf %s "$response" | awk -F= '$1=="authToken"{print $2}' RS=' '| cut -d '"' -f 2)

echo " *************************Token*******************************************"
echo $UserToken
echo " ***************************************************************************"

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [July 20, 2019, 8:10am UTC](https://forums.plex.tv/t/need-help-getting-a-plex-token-for-access/390973/8 "2019-07-20T08:10:38Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
