Skip to content

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

Closed
wants to merge 5 commits into from
Closed

Support for JWT Bearer #79

wants to merge 5 commits into from

Conversation

kralos
Copy link

@kralos kralos commented Aug 4, 2015

@kralos kralos changed the title #78 Support for JWT Bearer Support for JWT Bearer Aug 4, 2015
@kralos
Copy link
Author

kralos commented Aug 4, 2015

See Issue #78

@Spomky
Copy link

Spomky commented Sep 5, 2015

Looks good.
Ping @alanbem

@turneliusz
Copy link

@Spomky @alanbem any progress on that? Would love to use

@michaelfeinbier
Copy link

@alanbem It would be great to merge this!

@Spomky
Copy link

Spomky commented Mar 30, 2016

@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);
Copy link
Member

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 ?

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

Copy link

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()+,\-.:=@;$_!*'%/?#]+$

Copy link
Member

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);
}

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@GuilhemN
Copy link
Member

Can you add a test case to be sure this works as expected please?

@kralos
Copy link
Author

kralos commented Mar 31, 2016

Added test case and restored the FILTER_VALIDATE_URL checks etc for non-urn grant extensions since PHP thinks they are invalid

@turneliusz
Copy link

Looking forward, thanks @kralos !

GuilhemN added a commit that referenced this pull request Mar 31, 2016
@GuilhemN
Copy link
Member

Merged in fa2aecb, thank you @kralos !

I'll wait a bit to be completely sure this works as expected. Can you test it in your projects please?
Don't hesitate to ping me if I forget it for more than a week ;-)

@GuilhemN GuilhemN closed this Mar 31, 2016
@lsmith77 lsmith77 changed the title Support for JWT Bearer Support for JWT Bearer Mar 31, 2016
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

Successfully merging this pull request may close these issues.

5 participants