Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tables DDL doesnt match original #11

Open
weierophinney opened this issue Dec 31, 2019 · 1 comment
Open

Tables DDL doesnt match original #11

weierophinney opened this issue Dec 31, 2019 · 1 comment

Comments

@weierophinney
Copy link
Contributor

https://github.com/zfcampus/zf-oauth2/blob/master/data/db_oauth2.sql
https://github.com/zfcampus/zf-oauth2/blob/master/data/db_oauth2_postgresql.sql

Both of scripts contain extra columns client_id & type in table oauth_scopes. And primary key is missing.

Original DLL looks like this: https://github.com/bshaffer/oauth2-server-php/blob/develop/src/OAuth2/Storage/Pdo.php#L519


Originally posted by @autowp at zfcampus/zf-oauth2#142

@weierophinney
Copy link
Contributor Author

As for the missing PK:
As defined in RFC 6749#3.3, a scope is a space delimited list of values, whose order doesn't matter.
You can also see that at this line, the scope "reference" is a 4000 string... IMHO, there's no point of making that column a primary key. Maybe adding an UNIQUE constraint if you care about unicity. Also, in general, there's not that amount of scopes to leverage INDEX SQL features.
As for other fields:
Again, RFC does not precise the scope of the scopes :) It's up to the resource owner to define the business implementation of the scopes. So extra columns with no constraints does not interfere with OAuth2 authorization workflow.


Originally posted by @jguittard at zfcampus/zf-oauth2#142 (comment)

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

No branches or pull requests

1 participant