thephpleague / oauth2-server

A spec compliant, secure by default PHP OAuth 2.0 Server
https://oauth2.thephpleague.com
MIT License
6.52k stars 1.12k forks source link

Allow appending custom jwt token data to the request #1363

Closed parallels999 closed 1 year ago

parallels999 commented 1 year ago

Currently, it's easy to implement the convertToJWT method in the AccessTokenEntityInterface implementation to add data to the JWT. However, i don't see any solution, except creating a new implementation of BearerTokenValidator, to add additional attributes from the token, to the returning ServerRequestInterface object.

I think this PR can provide a way to simply override the BearerTokenValidator::appendAttributesFromClaims() method and pass the custom BearerTokenValidator instance to the ResourceServer instance.

Complement of #1328 Alternative of #851

parallels999 commented 1 year ago

Closed because #1328 added the same now