For this, you need to generate an Authentication Token so that Home Assistant is seen as a client by Plex.
Do do this via the cli, using curl, you can use the following command:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" \ -H 'X-Plex-Version: <SOME VERSION NUMBER>' \ -H 'X-Plex-Product: <SOME PRODUCT NAME>' \ -H 'X-Plex-Client-Identifier: <SOME UNIQUE IDENTIFIER>' \ --data-urlencode "user[password]=<YOURPASSHERE>" \ --data-urlencode "user[login]=<YOURUSERHERE>" \ https://plex.tv/users/sign_in.json
replacing the stuff between <> with your actual values.
When you run this command, you’ll get some json back, in which you need to look for
This string will be the authentication token you will need to give to Home Assistant.