laravel / passport

Laravel Passport provides OAuth2 server support to Laravel.
https://laravel.com/docs/passport
MIT License
3.29k stars 780 forks source link

[11.x] Allow overriding the `AccessToken` class #1638

Closed hafezdivandari closed 1 year ago

hafezdivandari commented 1 year ago

Related to #94, #1637, This PR allows overriding the Laravel\Passport\Bridge\AccessToken class by calling Passport::useAccessTokenEntity.

Why?

This class has convertToJWT method that can be overridden to add custom claims to JWT token, as there seems to be no other way to do this atm.

PS: It may be even more convenient after this: thephpleague/oauth2-server#1328

StefanoMantero commented 1 year ago

Looking forward to use this ! C:

PaolaRuby commented 1 year ago

hi, @driesvints, Is there a possibility to add this in 10.x?

driesvints commented 1 year ago

@PaolaRuby 10.x is closed for new features. Please upgrade to 11.x