thephpleague / oauth2-server-bundle

Symfony bundle for the OAuth2 Server.
MIT License
176 stars 86 forks source link

Support for user_identifier #9

Open Wulfu opened 3 years ago

Wulfu commented 3 years ago

Hi, is there any way to add user_identifier to bearer token in claim sub attribute?

I would like to get that identifier in my controller easy by just calling $this->getUser() wihick now is null because that user_identifier is not present in token clam and hardcoded to be null on creation and authorization.

Any smart way of overcoming this?

KorvinSzanto commented 2 years ago

@Wulfu the only way I've been able to do this is by adding a decorator to any created AccessTokens. This required I create a custom AccessTokenRepository but it was pretty easy to do.