Skip to content
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

add support for SIOP request JWT #262

Merged
merged 5 commits into from
Dec 13, 2022

Conversation

siacomuzzi
Copy link
Contributor

@siacomuzzi siacomuzzi commented Dec 8, 2022

According to JWT Presentation Profile, the SIOP Request JWT does not contain an iss claim, it must have a client_id claim instead. See https://identity.foundation/jwt-vc-presentation-profile/#self-issued-op-request-object

image

According to JWT Presentation Profile, the SIOP Request's JWT does not contain an `iss` claim, it must have a `client_id` claim instead. See https://identity.foundation/jwt-vc-presentation-profile/#self-issued-op-request-object
@siacomuzzi siacomuzzi changed the title add support for SIOP request payloads add support for SIOP request JWT Dec 8, 2022
src/JWT.ts Outdated
@@ -423,7 +423,7 @@ export async function verifyJWT(
}
did = payload.did
} else {
did = payload.iss
did = payload.iss || payload.client_id
Copy link

@OR13 OR13 Dec 8, 2022

Choose a reason for hiding this comment

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

What if iss and client_id are both present and not equivalent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added an IF statement just for this kind of JWT

Copy link
Contributor Author

@siacomuzzi siacomuzzi Dec 9, 2022

Choose a reason for hiding this comment

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

In order to avoid breaking changes, this logic is now executed only when iss isn't present.
Also, JWT Presentation Profile isn't expecting an iss claim in this specific JWT, see https://identity.foundation/jwt-vc-presentation-profile/#non-normative-request-object

Copy link
Contributor Author

@siacomuzzi siacomuzzi Dec 12, 2022

Choose a reason for hiding this comment

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

What if iss and client_id are both present and not equivalent.

According to the spec, iss shouldn't be present. So, if both iss and client_id are present, this proposed logic isn't reached.
The tricky part here is that there is no a direct way to detect if payload belongs to a JWT Presentation Profile request.

Copy link

@OR13 OR13 left a comment

Choose a reason for hiding this comment

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

prefer to see handling of iss and client_id alignment or misalignment.

@siacomuzzi siacomuzzi requested a review from OR13 December 9, 2022 13:48
Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

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

Looks great!

Thank you for adding this.

@siacomuzzi
Copy link
Contributor Author

Looks great!

Thank you for adding this.

Thank you for your review! Do you have plans to publish a new release that includes this change soon?

@mirceanis
Copy link
Member

Looks great!
Thank you for adding this.

Thank you for your review! Do you have plans to publish a new release that includes this change soon?

Of course

@mirceanis mirceanis merged commit 3259ffd into decentralized-identity:master Dec 13, 2022
uport-automation-bot pushed a commit that referenced this pull request Dec 13, 2022
# [6.11.0](6.10.1...6.11.0) (2022-12-13)

### Features

* add support for SIOP request JWT ([#262](#262)) ([3259ffd](3259ffd))
@uport-automation-bot
Copy link
Collaborator

🎉 This PR is included in version 6.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants