Skip to content

Correct OAuth2 key generation and token revocation in v7 docs - #162

Merged
arhimede merged 2 commits into
mainfrom
oauth2-keys-and-revocation
Sep 5, 2026
Merged

Correct OAuth2 key generation and token revocation in v7 docs#162
arhimede merged 2 commits into
mainfrom
oauth2-keys-and-revocation

Conversation

@arhimede

@arhimede arhimede commented Sep 4, 2026

Copy link
Copy Markdown
Member

Keys are generated by php ./bin/generate-oauth2-keys.php, which skips when all three files in data/oauth exist, so updates no longer invalidate issued tokens (7.2.0, issue #503). UserService::revokeTokens() is private; document the repository methods instead. Adds a key rotation FAQ.

Keys are generated by php ./bin/generate-oauth2-keys.php, which skips when
all three files in data/oauth exist, so updates no longer invalidate issued
tokens (7.2.0, issue #503). UserService::revokeTokens() is private; document
the repository methods instead. Adds a key rotation FAQ.

Signed-off-by: arhimede <julian@dotkernel.com>
@arhimede
arhimede requested a review from alexmerlin September 4, 2026 19:33
Comment on lines +39 to +40
Dotkernel API runs its own `php ./bin/generate-oauth2-keys.php` script to create the public/private
key pair and the encryption key used to sign and verify the transmitted JWTs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More sentence splitting...

Comment on lines +51 to +55
**Existing keys are never overwritten.** The script checks for `data/oauth/encryption.key`,
`data/oauth/private.key` and `data/oauth/public.key`; if all three are present it prints
`OAuth2 keys already exist. Skipping...` and stops.
Only when one is missing does it delegate to
`vendor/mezzio/mezzio-authentication-oauth2/bin/generate-oauth2-keys` to generate the set.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some sentence splitting happening here as well...

Comment on lines +25 to +33
> If your application requires it, you can revoke a user's OAuth tokens before they expire.
> `UserService::revokeTokens()` is `private`, so it cannot be called from your own code; it runs as
> part of the public `UserService::deleteUser()`, which revokes the tokens and then anonymizes the
> account.
>
> To revoke tokens on their own, use the token repositories directly: fetch the user's tokens with
> `OAuthAccessTokenRepository::findAccessTokens($identity)`, then pass each token to
> `OAuthAccessTokenRepository::revokeAccessToken()` and
> `OAuthRefreshTokenRepository::revokeRefreshToken()`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence splitting, even though it's disguised in a quote (because it starts with > ).

Unwraps six sentences that were split across lines. No wording changes.

Signed-off-by: arhimede <julian@dotkernel.com>
@arhimede
arhimede merged commit 5c1337d into main Sep 5, 2026
10 checks passed
@arhimede
arhimede deleted the oauth2-keys-and-revocation branch September 5, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants