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

Problem with local dev config for demo issuer front-end #10

Open
nedgar opened this issue Jun 30, 2023 · 4 comments
Open

Problem with local dev config for demo issuer front-end #10

nedgar opened this issue Jun 30, 2023 · 4 comments

Comments

@nedgar
Copy link

nedgar commented Jun 30, 2023

I'm trying to run the issuer front-end locally on my dev machine, either against the local agent (via ngrok) or the one at https://ssi.sphereon.com.

In .env.local, copied from .env per the instructions, should it have:
REACT_APP_OID4VP_PRESENTATION_DEF_ID=sphereon (like in the .env file)
or
REACT_APP_OID4VP_PRESENTATION_DEF_ID=sphereon2023 (like in the README)

Example packages/oid4vci-demo-frontend/.env.local:

REACT_APP_OID4VP_AGENT_BASE_URL=https://ssi.sphereon.com/agent
REACT_APP_OID4VP_PRESENTATION_DEF_ID=sphereon
REACT_APP_OID4VCI_AGENT_BASE_URL=https://ssi.sphereon.com/issuer/sphereon2023
REACT_APP_ENVIRONMENT=sphereon
PORT=5001

With REACT_APP_OID4VP_PRESENTATION_DEF_ID as sphereon, trying to log in with the Sphereon ID wallet app (latest iOS version) fails with:

Unable to retrieve information. Error: undefined is not an object (evaluating 'e.claims.vp_token')

The payload of the auth request JWT doesn't contain any claims, and the app isn't resilient to that, surfacing the low level error.

74C1FBE5-D845-408C-B9E5-D49058BF99A6_1_105_c

If I change it to sphereon2023, it gets further, but the wallet prompts for the guest credential, not the primary wallet ID credential. In the expected demo flow, this is only issued later, after authenticating.

If instead I enter the auth info manually, it goes through OK to issuing the guest credential

@nklomp I see there have been recent changes here. Could you please clarify?

@nedgar
Copy link
Author

nedgar commented Jun 30, 2023

@nedgar nedgar changed the title Problem with local dev config for issuer front-end Problem with local dev config for demo issuer front-end Jun 30, 2023
@nedgar
Copy link
Author

nedgar commented Jun 30, 2023

To use ngrok to tunnel to my locally running agent, I also had to change the credential_issuer and credential_endpoint in packages/agent/conf/dev/oid4vci_metadata/sphereon.json:

"correlationId": "http://192.168.2.90:5000/sphereon2023",
"overwriteExisting": true,
"metadata": {
"credential_issuer": "http://192.168.2.90:5000/sphereon2023",
"credential_endpoint": "http://192.168.2.90:5000/sphereon2023/credentials",

It would be nice if the agent endpoint could be configured purely through env vars.

Does the correlationId need to be a URL or can it be a URI that's not tied to the actual deployment address?

@nedgar
Copy link
Author

nedgar commented Jul 7, 2023

Through experimentation with the public demo issuer at https://ssi.sphereon.com/demo/issuer/#/credentials/verify/request, I see it uses the sphereonWallet definition ID (not sphereon or sphereon2023). Running the demo issuer locally, if I change packages/oid4vci-demo-frontend/.env.local to have:

REACT_APP_OID4VP_AGENT_BASE_URL=https://ssi.sphereon.com/agent
REACT_APP_OID4VP_PRESENTATION_DEF_ID=sphereonWallet
REACT_APP_OID4VCI_AGENT_BASE_URL=https://ssi.sphereon.com/sphereon2023
REACT_APP_ENVIRONMENT=sphereon
PORT=5001

then the fetched auth request includes the correct claims > vp_token > presentation_definition for the identity challenge:

...
  "claims": {
    "vp_token": {
      "presentation_definition": {
        "id": "sphereonWallet",
        "purpose": "You need to prove your Wallet Identity data",
        "submission_requirements": [
          {
            "name": "Sphereon Wallet Identity",
            "rule": "pick",
            "min": 0,
            "max": 1,
            "from": "A"
          }
        ],
        "input_descriptors": [
          {
            "id": "SphereonWalletId",
            "purpose": "Checking your Sphereon Wallet information",
            "name": "Wallet Identity",
            "group": [
              "A"
            ],
            "schema": [
              {
                "uri": "https://sphereon-opensource.github.io/ssi-mobile-wallet/context/sphereon-wallet-identity-v1.jsonld"
              }
            ]
          }
        ]
      }
    }
  },
...

However, the Sphereon Wallet App now hangs and times out with a 504 gateway error when trying to fetch this. Fetching it at the same URL from my laptop works OK. Strange. Does the wallet use a proxy?

@nedgar
Copy link
Author

nedgar commented Jul 7, 2023

The demo agent doesn't have any definition with ID sphereonWallet though. Is that definition missing from the open source?

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

No branches or pull requests

1 participant