Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

access token validation should not require a sub claim #333

Closed
sigratton opened this issue Aug 12, 2017 · 4 comments
Closed

access token validation should not require a sub claim #333

sigratton opened this issue Aug 12, 2017 · 4 comments
Assignees

Comments

@sigratton
Copy link

The current implementation of jsonWebToken.verify enforces that a sub claim is present in the token. There is no notion of a sub claim in an access token that has been obtained via a client credentials flow, since it is designed for server to server interaction. Hence the BearerStrategy returns a 401 when presented with an token from client creds, because the jwt verify fails on line 170/171

I suggest the check on line 170 & 171 be removed. Happy to submit a PR.

@lovemaths
Copy link
Contributor

@sigratton Thank you for pointing it out. jsonWebToken.verify is used to verify both id_token and access_token, so we cannot simply remove that line. We will make the changes to support the client credential token and let you know once the fix is ready.

@lovemaths lovemaths self-assigned this Aug 14, 2017
@sigratton
Copy link
Author

sigratton commented Aug 15, 2017 via email

@lovemaths lovemaths changed the title Client Credentials flow should not require a sub claim - jsonWebToken.js like 170 access token validation should not require a sub claim Aug 15, 2017
@lovemaths
Copy link
Contributor

@sigratton Yes that's right. Please take a look at my PR (#334), see if the change works for you. Thank you.

lovemaths added a commit that referenced this issue Aug 17, 2017
Issue #333 jwt should not check sub for access token
@lovemaths
Copy link
Contributor

Closing since it is committed to dev branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants