-
Notifications
You must be signed in to change notification settings - Fork 112
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
Scope Policy functionality #45
Conversation
* @param string $scope | ||
* The scopes to check. | ||
* | ||
* @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing return type
@alanbem what about a new branch to go to the RFC while the master one is slowly updated? |
I'm little scared of amount of backporting we would have to manage. |
Would it be a lot of work to make that feature backward compatible e.g. create new scope policy I could make a merge regardless of the result of RFC vs draft discussion (we could move it and continue somewhere else). |
There is nothing to do to make that feature compatible with the current master. The only difference is that this PR also fixes #25, because it does not set all scopes to the token, but only those passed by the input (that is why I have modified the test). |
Hi, I just tested your code and unfortunately it seems buggy. When I requested token with |
@alanbem you are right. I have just added a new test and fix that issue. |
I agree, this is not draft20 compliant, but it's a really missing feature too. As I explained in an issue ticket in the fos/oauth-server-bundle repo (FriendsOfSymfony/FOSOAuthServerBundle#201), serious issues could appear without scope policy management... So I think I'm gonna vote +1 on this one 👍 |
The requested scope is only "scope1"in this test, so the access token only contains "scope1" and not "scope1 scope2" as before.
Function documentation modified according to Stof's coments. Tests added.
Hardcoded policy values are now constants
Unknown scope policy test added
invalid_scope_policy is not part of the RFC6749
This commit fixes the issue and adds a new test.
* Clients can override the default scopes and scope policy defined by the application * Tests updated
Supported scopes can be defined by clients (eg: limitation depending on the client type).
@Spomky look at So if no scope is requested we should take those methods @Spomky I was sure I've added that comment few weeks ago... but I haven't... I think I was on "Preview" mode and forgot to send it :/ Sorry for that buddy! |
In fact there are two functionnalities in this PR. Only the second needs to modify interfaces and breaks the compatibility. I have read again the code of |
Its because proprietary storage interfaces e.g. It is pretty easy to extend storage (or wrap it up inside another proxy-like object) and implement this functionality. For example I could store allowed |
Hi @alanbem , I think this bundle is a good bundle, but it should really be updated from draft 20 to RFC. I have decided to start a new project based on this bundle. As you you are already a member of my fork and you really know the OAuth flow, I will be proud if you participate, even if you just give some advices. BR |
In RFC6749' we can read
This PR add this rule.
Supported scopes, default scopes and scope policy can be defined per client (eg: limitation of supported scope depending on the client's type).
New parameters have been added:
CONFIG_SCOPES_POLICY
: set the policy of the server (either error or default)CONFIG_DEFAULT_SCOPES
: if policy is default, this array of scopes will be used as default.This PR also fix bug #25
It changes the client interface, so that this PR breaks compatibility and requires to bump version number.