API-Skeletons / oauth2-doctrine

Doctrine oauth2 adapter for Laminas API Tools
4 stars 9 forks source link

[RFC] AccessToken / RefreshToken -> Scope relation #14

Open darckking opened 2 years ago

darckking commented 2 years ago

Hi Can you pls explain your motivation to use ManyToMany between AccessToken and Scope ? This differs from laminas-api-tools/api-tools-oauth2 database structure. There scope is space-separated list of restricted scopes and is baked into AccessToken / RefreshToken. Imo the ManyToMany brings tiny overhead: 1) it will trigger DB call to get all token's scopes; 2) you will need join scopes to pull all you need from DB with one query; 3) extra insertions when create token with bunch of scopes;