GithubHelp home page GithubHelp logo

Comments (3)

sietseringers avatar sietseringers commented on July 29, 2024 1

The last argument to the testsig.js script should be the base path to your configuration folder, so in your case /etc/irma_api_server. So can you try:

node utils/testsig.js http://localhost:8088 /etc/irma_api_server

(Explanation: the irma_api_server signs its responses using its private key. The testsig.js script needs to lookup the corresponding public key in order to verify these signatures. The fourth parameter points to the directory in which it looks for this public key.)

As to the error that testip.js throws, I'm aware of that problem, it is something I still have to fix. For now, you can avoid it by ensuring that the validity fields within the iprequest variable in the testip.js script are a multiple of the epoch length, which is 60*60*24*7 which equals 604800.

In addition, your problems tell me that that the README's are unhelpful/unsufficiently clear at a number of places. Will fix; thanks for reporting these issues. 🙂

from irma_api_server.

sietseringers avatar sietseringers commented on July 29, 2024

Your configuration folder seems to be almost correct, except for the following: the irma-demo folder should be inside a folder called irma_configuration, i.e., /etc/irma_api_server/irma_configuration/irma-demo. Probably it will run fine once you move it.

from irma_api_server.

chespinoza avatar chespinoza commented on July 29, 2024

Thanks @sietseringers for your response, seems like I'm almost there, now running the testsp.js and testsig.js script I'm getting this another error:

bash-4.4# node utils/testsig.js http://localhost:8088 /etc/irma_api_server/irma_configuration/irma-demo/
{ uri: 'http://localhost:8088/irma_api_server/api/v2/signature/',
  method: 'POST',
  body: 'eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJhYnNyZXF1ZXN0Ijp7ImRhdGEiOiJmb29iYXIiLCJ2YWxpZGl0eSI6NjAsInRpbWVvdXQiOjYwLCJyZXF1ZXN0Ijp7Im1lc3NhZ2UiOiJNZXNzYWdlIHRvIGJlIHNpZ25lZCIsIm1lc3NhZ2VUeXBlIjoiU1RSSU5HIiwiY29udGVudCI6W3sibGFiZWwiOiJOYW1lIiwiYXR0cmlidXRlcyI6eyJpcm1hLWRlbW8uTWlqbk92ZXJoZWlkLmZ1bGxOYW1lLmZpcnN0bmFtZSI6IkpvaGFuIn19LHsibGFiZWwiOiJPdmVyIDIxIiwiYXR0cmlidXRlcyI6WyJpcm1hLWRlbW8uTWlqbk92ZXJoZWlkLmFnZUxvd2VyLm92ZXIxOCIsImlybWEtZGVtby5NaWpuT3ZlcmhlaWQuYWdlTG93ZXIub3ZlcjIxIl19XX19LCJpYXQiOjE1MjI1MzY0NTUsImlzcyI6InRlc3RzaWdjbGllbnQiLCJzdWIiOiJzaWduYXR1cmVfcmVxdWVzdCJ9.' }
{ u: 'http://localhost:8088/irma_api_server/api/v2/signature/tCyJed5dozcnwsDnCQSxuwFr5cdIuqE08DI4W6ce3R',
  v: '2.0',
  vmax: '2.3',
  irmaqr: 'signing' }















































.
Did not receive a valid token (error: "JsonWebTokenError: invalid signature")
Data: eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhYnNfcmVzdWx0IiwiaXNzIjoiaXJtYV9hcGlfc2VydmVyLWRlbW8iLCJleHAiOjE1MjI1MzY1MTUsImlhdCI6MTUyMjUzNjQ1NSwianRpIjoiZm9vYmFyIiwic3RhdHVzIjoiV0FJVElORyJ9.RfLFDuRnW6GhnP7OE6vVKEpbGNRNwjcV__hbmLBgtNN3Pb2Ylc2dg82232vd9ddBwz4A5lf1gR7EbE6cgjE1fp79L7Rxw_ZPTz63DjKBTV8U8yoFI3Okf6E6G-SorWAwcF-QwecLUtvs9qlkeACx8MnEZfzL5tMtVSspCV5dAkA6C-bS3ZubnM9a65CE_BVYqJgPugA0Jdl8_IpT2PUC5GnU3g2csnDhM0vqdzr6hV2r0gJfNsCQTk8aCVnVx-p9h7IjDYu_kIz3h_Hal5V2S-hXWpXWee2-KxknJ_g44HEBgMqT5nY7haKoYwaC8sxph6XGkbMessQHYZ118eBgGQ

I can see the ascii QR image, the server log is:

22:47:35.358 [qtp693958407-12] INFO  org.irmacard.api.common.JwtParser - Trying signed JWT
22:47:35.701 [qtp693958407-12] INFO  org.irmacard.api.common.JwtParser - Trying unsigned JWT
22:47:35.702 [qtp693958407-12] WARN  org.irmacard.api.common.JwtParser - Discarding JWT signature!
22:47:35.867 [qtp693958407-12] INFO  o.i.api.web.sessions.IrmaSession - Delaying removal of session tCyJed5dozcnwsDnCQSxuwFr5cdIuqE08DI4W6ce3R with 60 seconds
22:47:35.873 [qtp693958407-12] INFO  o.i.api.web.resources.BaseResource - Received session, token: tCyJed5dozcnwsDnCQSxuwFr5cdIuqE08DI4W6ce3R
22:47:35.874 [qtp693958407-12] INFO  o.i.api.web.resources.BaseResource - {"message":"Message to be signed","messageType":"STRING","content":[{"label":"Name","attributes":{"irma-demo.MijnOverheid.fullName.firstname":"Johan"}},{"label":"Over 21","attributes":["irma-demo.MijnOverheid.ageLower.over18","irma-demo.MijnOverheid.ageLower.over21"]}],"nonce":128412368525445484362515,"context":6843305777297633778428958291407488105800139522700197659280399045734489508822}

And when running testip.js the next error:

bash-4.4# node utils/testip.js http://localhost:8088 /etc/irma_api_server/irma_configuration/irma-demo/
eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJpcHJlcXVlc3QiOnsiZGF0YSI6ImZvb2JhciIsInRpbWVvdXQiOjYwLCJyZXF1ZXN0Ijp7ImNyZWRlbnRpYWxzIjpbeyJjcmVkZW50aWFsIjoiaXJtYS1kZW1vLk1pam5PdmVyaGVpZC5hZ2VMb3dlciIsInZhbGlkaXR5IjoxNTgyOTY5NjAwLCJhdHRyaWJ1dGVzIjp7Im92ZXIxMiI6InllcyIsIm92ZXIxNiI6InllcyIsIm92ZXIxOCI6InllcyIsIm92ZXIyMSI6Im5vIn19LHsiY3JlZGVudGlhbCI6ImlybWEtZGVtby5NaWpuT3ZlcmhlaWQuYWRkcmVzcyIsInZhbGlkaXR5IjoxNTgyOTY5NjAwLCJhdHRyaWJ1dGVzIjp7ImNvdW50cnkiOiJUaGUgTmV0aGVybGFuZHMiLCJjaXR5IjoiTmlqbWVnZW4iLCJzdHJlZXQiOiJUb2Vybm9vaXZlbGQgMjEyIiwiemlwY29kZSI6IjY1MjUgRUMifX1dfX0sImlhdCI6MTUyMjUzNjYwNSwiaXNzIjoidGVzdGlwIiwic3ViIjoiaXNzdWVfcmVxdWVzdCJ9.
Error in initial request:  null
{"error":"INVALID_TIMESTAMP","status":400,"description":"Timestamp was not an epoch boundary","message":"Epoch length: 604800000","stacktrace":"org.irmacard.api.common.exceptions.ApiException: Epoch length: 604800000\n\tat org.irmacard.api.web.resources.IssueResource.create(IssueResource.java:138)\n\tat org.irmacard.api.web.resources.IssueResource.create(IssueResource.java:40)\n\tat org.irmacard.api.web.resources.BaseResource.newSession(BaseResource.java:92)\n\tat org.irmacard.api.web.resources.IssueResource.newSession(IssueResource.java:59)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)\n\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)\n\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)\n\tat org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)\n\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)\n\tat org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)\n\tat org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)\n\tat org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)\n\tat org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)\n\tat org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)\n\tat org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)\n\tat org.glassfish.jersey.internal.Errors.process(Errors.java:315)\n\tat org.glassfish.jersey.internal.Errors.process(Errors.java:297)\n\tat org.glassfish.jersey.internal.Errors.process(Errors.java:267)\n\tat org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)\n\tat org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)\n\tat org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)\n\tat org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)\n\tat org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)\n\tat org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)\n\tat org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)\n\tat org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\n\tat org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:224)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:497)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\n\tat java.lang.Thread.run(Thread.java:748)\n"}

And the server log:

22:50:05.431 [qtp693958407-11] INFO  org.irmacard.api.common.JwtParser - Trying signed JWT
22:50:05.436 [qtp693958407-11] INFO  org.irmacard.api.common.JwtParser - Trying unsigned JWT
22:50:05.436 [qtp693958407-11] WARN  org.irmacard.api.common.JwtParser - Discarding JWT signature!

from irma_api_server.

Related Issues (8)

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.