Giter Club home page Giter Club logo

Comments (2)

ismapolis avatar ismapolis commented on September 27, 2024

The URI value I am using is generated when a credential option is selected and a QR code is generated. I simply copy the URL and insert it into the code. The URL always looks like this: openid-credential-offer://?credential_offer=%7B%22grants%22%3A%7B%22urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code%22%3A%7B%22pre-authorized_code%22%3A%22wzUetZE7ytnS8n4ZwbLHwG%22%2C%22user_pin_required%22%3Afalse%7D%7D%2C%22credentials%22%3A%5B%22GuestCredential%22%5D%2C%22credential_issuer%22%3A%22https%3A%2F%2Fssi.sphereon.com%2Fpf3%22%7D

from oid4vc-demo.

nklomp avatar nklomp commented on September 27, 2024

Hi @ismapolis

I have been looking into your issue. You can see your code incorporated into a test here: https://github.com/Sphereon-Opensource/OID4VCI/blob/9f4eca6130a045e20999506c1ded96abddcd9f41/packages/client/lib/__tests__/SphereonE2E.spec.test.ts#L119
The above code also automatically creates a new offer, so you do not have to copy paste anything ;)

First of all probably good for you to know for next time is that you can include the following line to get more information about any errors and/or payloads:

debug.enable('*') 
// or debug.enable('sphereon:*')

Then you would get this response payload on your console:

sphereon:openid4vci:http error status: 500, body:
  sphereon:openid4vci:http {"error":"invalid_request","error_description":"invalid_jwt: JWT not valid yet (issued in the future) iat: 1699049651145"}

The issue is that in your code you are using +new Date() for the issuedAt value, but that should be devided by 1000 (seconds vs milliseconds) for JWTs. If you just call it with setIssuedAt() it will automatically use current date

After fixing that some small other errors occured which had to do with some values in the JWT sign callback missing. You need to provide a kid header as well as set the correct typ ('openid4vci-proof+jwt')

from oid4vc-demo.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.