-
Notifications
You must be signed in to change notification settings - Fork 200
Add support for Plex JWT Authentication #1554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Plex JWT Authentication #1554
Conversation
16b4d54 to
75a134b
Compare
48882ce to
077a5cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Plex JWT Authentication, implementing a new authentication method that uses JSON Web Tokens with ED25519 key pairs as described in the Plex API documentation.
Key changes include:
- Implementation of a new
MyPlexJWTLoginclass for handling JWT-based authentication flows (OAuth and token-based) - Addition of
plexJWTAuth()helper function for simplified JWT authentication using OAuth - Support for ED25519 keypair generation, JWT encoding/decoding, and token refresh functionality
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements_dev.txt | Adds pyjwt[crypto] as a development dependency for JWT functionality |
| pyproject.toml | Adds optional 'jwt' dependency group for JWT authentication support |
| plexapi/utils.py | Adds JWT authentication helper functions, UUID generation, base64url encoding, and updates to existing OAuth functions for consistency |
| plexapi/myplex.py | Implements MyPlexJWTLogin class with JWT generation, verification, refresh, and device registration capabilities |
| README.rst | Documents the new JWT optional dependency installation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
Ref.: https://developer.plex.tv/pms/#section/API-Info/Authenticating-with-Plex
myplex.MyPlexJWTAuthclass to handle Plex JWT authentication.utils.plexJWTAuth()helper function for Plex JWT authentication.Example using class:
Example using helper function:
Type of change
Please delete options that are not relevant.
Checklist: