-
Notifications
You must be signed in to change notification settings - Fork 111
Support for JWT Bearer #79
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
Conversation
…wt-bearer-12 Please note, http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.5 refers to a URI which is defined as a URL or URN http://www.rfc-editor.org/rfc/rfc3305.txt
See Issue #78 |
Looks good. |
@alanbem It would be great to merge this! |
@Ener-Getick can you merge and tag this PR? |
@@ -1001,8 +997,7 @@ protected function grantAccessTokenExtension(IOAuth2Client $client, array $input | |||
if (!($this->storage instanceof IOAuth2GrantExtension)) { | |||
throw new OAuth2ServerException(self::HTTP_BAD_REQUEST, self::ERROR_UNSUPPORTED_GRANT_TYPE); | |||
} | |||
$uri = filter_var($inputData["grant_type"], FILTER_VALIDATE_URL); |
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.
why did you remove this ?
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.
URN is valid URL so should work with it
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.
You may check both URI and URN.
A regex pattern for URN could be something like ^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]+$
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.
Wouldn't it be better to do:
if (false === strpos($inputData['grant_type'], 'urn') {
$uri = filter_var($inputData["grant_type"], FILTER_VALIDATE_URL);
}
?
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.
@turneliusz actually, it doesn't work https://secure.php.net/manual/fr/filter.filters.validate.php#110411
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.
@Ener-Getick good to know, thx
Can you add a test case to be sure this works as expected please? |
…tension grant types, added unit test for urn access token
Added test case and restored the |
Looking forward, thanks @kralos ! |
https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer-12
Please note, http://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.5 refers to a URI which is defined as a URL or URN http://www.rfc-editor.org/rfc/rfc3305.txt