Add support for Plex JWT Authentication#1554
Merged
JonnyWong16 merged 10 commits intopushingkarmaorg:masterfrom Nov 3, 2025
Merged
Add support for Plex JWT Authentication#1554JonnyWong16 merged 10 commits intopushingkarmaorg:masterfrom
JonnyWong16 merged 10 commits intopushingkarmaorg:masterfrom
Conversation
16b4d54 to
75a134b
Compare
48882ce to
077a5cf
Compare
Contributor
There 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.
JonnyWong16
added a commit
to JonnyWong16/python-plexapi
that referenced
this pull request
Nov 18, 2025
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: