openwallet-foundation / bifold-wallet

Aries Mobile Agent React Native - Part of the Aries Bifold effort to provide SSI capabilities in a production ready app.
Apache License 2.0
149 stars 146 forks source link

Invitation from aca-py agent with aca-py mediator between #37

Closed papkie closed 3 years ago

papkie commented 3 years ago

Hey.

I'm trying to make a connection with another agent with a mediator between. I can connect from react native app (using code from this repo) to aca-py mediator, but had to move the invitation to another server (/invitation path does not exist in aca-py admin). I don't know if it's good, but it works.

The issue is when I want to connect with another aca-py agent with mediator between. When I try to receive invitation on mobile I'm getting message in react native app:

New Connection Record
{
    "_didDoc":
    {
        "@context": "https://w3id.org/did/v1",
        "authentication":
        [
            [
                undefined
            ]
        ],
        "id": "Cv5XNG6AW7bQNSz49M3a8h",
        "publicKey":
        [
            [
                undefined
            ]
        ],
        "service":
        [
            [
                undefined
            ]
        ]
    },
    "_invitation":
    {
        "@id": "859fec9e-ad20-4fe1-bc5b-2585e52636cc",
        "@type": "https://didcomm.org/connections/1.0/invitation",
        "label": "label",
        "recipientKeys":
        [
            "G9JytRnX8tx6uSetjPyYuSkwwVrDFm23LB8GGK7ifB4k"
        ],
        "routingKeys":
        [
            "8zNjW3SZt9Tc94dmHjpGdm5qGL8EFQNPMXVCHqJR88ff"
        ],
        "serviceEndpoint": "http://x:3006/"
    },
    "_theirDidDoc": undefined,
    "alias": undefined,
    "autoAcceptConnection": true,
    "createdAt": 1618056938615,
    "did": "Cv5XNG6AW7bQNSz49M3a8h",
    "endpoint": undefined,
    "id": "d12851bc-f05c-46af-8c7a-721023b1a960",
    "role": "INVITEE",
    "state": "requested",
    "tags":
    {
        "invitationKey": "G9JytRnX8tx6uSetjPyYuSkwwVrDFm23LB8GGK7ifB4k",
        "verkey": "7VfLb6mWcLz3apc3Z1dQxcytAghm4E4c2iKppVYdLXB3"
    },
    "theirDid": undefined,
    "type": "ConnectionRecord",
    "verkey": "7VfLb6mWcLz3apc3Z1dQxcytAghm4E4c2iKppVYdLXB3"
}

But I'm getting an error on edge agent (mediator looks good - it shows messages regarding forwarded messages):

2021-04-10 07:17:57,143 aries_cloudagent.core.conductor WARNING Cannot queue message for delivery, no supported transport

Invitation created by edge agent looks like this:

{
  "connection_id": "1281a500-aa9b-49ba-b8b8-7dba030772ba",
  "invitation": {
    "@type": "https://didcomm.org/connections/1.0/invitation",
    "@id": "16be3a5c-4cc7-4c2f-a182-6defe6665930",
    "recipientKeys": [
      "4hxjdd6u3iHyi9WnPfesh9nDvwAKmGZiskw1NiriWMNr"
    ],
    "label": "Edge",
    "serviceEndpoint": "http://x:3006/",
    "routingKeys": [
      "8zNjW3SZt9Tc94dmHjpGdm5qGL8EFQNPMXVCHqJR88ff"
    ]
  },
  "invitation_url": "http://x:3006/?c_i=invitation base 64"
}

I copy invitation url, then paste it to qr generator and scan it.

Mediator config:

aca-py start --wallet-type indy \
--seed 00000000000000000000000001Mediat \
--wallet-key mediatorkey \
--wallet-name mediator \
--label "Mediator" \
--open-mediation \
--genesis-url http://genesishost/genesis \
--inbound-transport http 0.0.0.0 3006 \
--inbound-transport ws 0.0.0.0 3008 \
--outbound-transport http \
--outbound-transport ws \
--admin 0.0.0.0 3007 \
--admin-insecure-mode --auto-accept-invites --auto-accept-requests --auto-ping-connection \
--log-level info \
-e http://x:3006/ \
--emit-new-didcomm-prefix 

Edge agent config:

aca-py start --wallet-type indy \
--seed 00000000000000000000000001Issuer \
--wallet-key issuerkey \
--wallet-name issuer \
--label "Edge" \
--inbound-transport http 0.0.0.0 3001 \
--inbound-transport ws 0.0.0.0 3003 \
--outbound-transport http \
--outbound-transport ws \
-e http://x:3001/ \
--admin 0.0.0.0 3002 \
--admin-insecure-mode --auto-accept-invites --auto-accept-requests --auto-ping-connection \
--log-level debug \
--genesis-url http://genesishost/genesis \
--emit-new-didcomm-prefix 

Mobile config:

      const agentConfig = new AgentConfig({
        mediatorUrl: Config.MEDIATOR_URL,
        label: 'Holder',
        walletConfig: {id: 'holder-wallet'},
        walletCredentials: {key: 'holderkey'},
        autoAcceptConnections: true,
        genesisPath,
        logger: new ConsoleLogger(LogLevel.debug),
        indy,
      })

Has anyone experienced an issue like this?

JamesKEbert commented 3 years ago

Sorry--been heads down in the work.

Currently we're working on adding the coordinate mediation protocol functionality to Aries Framework Javascript (AFJ), which is the protocol that ACA-Py conforms to. As of right now, AFJ has a custom mediator implementation as of today, which running the current AFJ mediator is documented here.

papkie commented 3 years ago

Understood, thank you!