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

chore: [SIW-1684] Expose iat and exp claims #143

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

gispada
Copy link
Collaborator

@gispada gispada commented Sep 27, 2024

List of Changes

  • verifyAndParseCredential returns iat and exp claims as issuedAt and expiration respectively

Motivation and Context

We need to know the expiration and issuance date of credentials. The exp claim is included in the JWT payload, the iat is found among disclosures.

This PR attempts to expose those claims in a simple and backward-compatible way, adding them to the object returned by verifyAndParseCredential. Since this function is always called at the end of the issuance flow, it is convenient to also get some additional metadata without requiring another step of verification/decode later.

The use of includeUndefinedAttributes was discarded to avoid getting claims not declared in the issuer configuration.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Contributor

@LazyAfternoons LazyAfternoons left a comment

Choose a reason for hiding this comment

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

LGTM

@LazyAfternoons LazyAfternoons added this pull request to the merge queue Sep 30, 2024
Merged via the queue into master with commit e9742e0 Sep 30, 2024
7 checks passed
@LazyAfternoons LazyAfternoons deleted the SIW-1684-iat-claim branch September 30, 2024 09:52
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.

2 participants