Open
Conversation
joehoyle
reviewed
Mar 31, 2026
| const META_PREFIX = '_oauth2_access_'; | ||
| const CLIENT_META_PREFIX = '_oauth2_client_token_'; | ||
| const KEY_LENGTH = 12; | ||
| const DEFAULT_TTL = 86400; // 24 hours in seconds |
Member
There was a problem hiding this comment.
I think this needs to be backwards compatible -- i.e. tokens need to have no expiry by default. Perhaps there could be a way to set the default per oauth2 application though. Also, I think the expires should be part of a seperate PR, as i dont think it's hard-linked to the client credentials grant
| /** | ||
| * Register settings, sections, and fields. | ||
| */ | ||
| function register_settings() { |
Member
There was a problem hiding this comment.
I might be missing something here, but couldn't the client_credentials_enabled be a per oauth2 application setting? So any existing oauth2 app could have client credentials enabled
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.
Adds support for the OAuth 2.0 Client Credentials grant type, enabling machine-to-machine authentication without user interaction. A client exchanges a
client_id+client_secretfor an access token that is not tied to any WordPress user.