Uh oh!
There was an error while loading. Please reload this page.
Add support for Plex JWT Authentication - #1554
Conversation
16b4d54 to
75a134bCompare48882ce to
077a5cfCompareThere was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Add private.key and public.key to .gitignore * Add `MyPlexJWTAuth` class * Add `utils.plexJWTAuth` helper function * Update optional dependencies for Plex JWT authentication * Add method to retrieve Plex JWT without initial Plex token * Update doc strings * Switch MyPlexJWTLogin to JSON response * Remove cached data properties * Guard against None keypair * Use UTC timezone for jwt
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: