Closed (works as designed)
Project:
Simple OAuth (OAuth2) & OpenID Connect
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2017 at 05:06 UTC
Updated:
2 Dec 2017 at 15:05 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
e0ipsoComment #3
skyredwangTwo questions:
1. Do we want to go stateless? If so, we can get rid off the entire $token_entity, including its creation and validation.
My understanding is "why not?". Removing this Drupal specific $token_entity simplifies things and increase performance.
2. According to https://www.slideshare.net/gauravroy/stateless-auth-using-oauth2-jwt slide #55, the token expiration claim shall use "exp" instead of "expire", which is already in use.
If we change the keyword, then we would have incompatibility issues with existing clients; if we add a duplicate "exp", then it's not super elegant, and confusing.
Comment #4
e0ipso@skyredwang thanks for your thoughtful comments.
I'm not opposed to it. In fact there are simpler implementations that do just that. However there are challenges that you'll need to figure out, like revoking tokens that have been issued. The PHP library we are using assumes there is a persistent store for tokens due to these things.
I'm open to suggestions though.
I think it's OK to rename to "exp". There was never explicit support for JWT because it was not standard compliant. This issue should fix that.
Comment #5
skyredwangI didn't think of this. It sounds reasonable. Citing from page 79 on https://www.slideshare.net/alvarosanchezmariscal/stateless-authenticatio...
Since statefull $token_entity management is already in place. I'd like to not change it, since it provides this extra feature.
The work for this issue is indeed what the original summary says, which should be straightforward, given the second answer from #4
Comment #6
alan_blake commented1. Post to `oauth/token` and the result is:
2. decode access_token on https://jwt.io/ and result is
3. Check the claims, only missing the "iss" (Issuer) Claim (https://tools.ietf.org/html/rfc7519#section-4.1)
Also check the upstream https://github.com/thephpleague/oauth2-server/blob/master/src/Entities/Traits/AccessTokenTrait.php that doesn't claim neither.
If we need this claim, maybe we should fix this on upstream.
Comment #7
e0ipsoThanks for the investigation @alan_blake. It turns out that the claim is not required after all:
https://tools.ietf.org/html/rfc7519#section-4.1