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

Fix Out-Of-Band invitation option for QR codes #556

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Conversation

loneil
Copy link
Contributor

@loneil loneil commented Jun 18, 2024

Fixes #545

Instead of building up a OOB invitation with code in VCAuth controller (this was not working, error boiled down to recipient keys not being added), call ACA-Py to use out-of-band/create-invitation with the resultant presentation exchange.
Use the invitation returned from that as the QR code linked payload.

Note this should only be used in QR code mode at the moment (which is what we configure in all envs for USE_OOB_PRESENT_PROOF) as doing it as a deep link runs into the 'too many characters' issue. A OOB is bigger than a Connections type so there's not really room for the actual proof unless it's narrowed to something as minimal as it gets.
This will be solved by #504 anyways, so we won't be using the current deep link paradigm much longer anyways.

Sample payload

{
    "@id": "3d2fca0b-39d1-4580-8744-cecb7a155bf3",
    "@type": "https://didcomm.org/out-of-band/1.1/invitation",
    "goal_code": "request-proof",
    "label": "VC-AuthN Agent",
    "requests~attach": [
        {
            "@id": "request-0",
            "mime-type": "application/json",
            "data": {
                "json": {
                    "@type": "https://didcomm.org/present-proof/1.0/request-presentation",
                    "@id": "a6f0d822-9ae0-4408-b324-2ac1cbe95b1a",
                    "~thread": {
                        "pthid": "3d2fca0b-39d1-4580-8744-cecb7a155bf3"
                    },
                    "request_presentations~attach": [
                        {
                            "@id": "libindy-request-presentation-0",
                            "mime-type": "application/json",
                            "data": {
                                "base64": "eyJuYW1lIjogInByb29mX3JlcXVlc3RlZCIsICJ2ZXJzaW9uIjogIjAuMC4xIiwgInJlcXVlc3RlZF9hdHRyaWJ1dGVzIjogeyJyZXFfYXR0cl8wIjogeyJuYW1lcyI6IFsiZ2l2ZW5fbmFtZXMiLCAiZmFtaWx5X25hbWUiLCAiY291bnRyeSJdLCAicmVzdHJpY3Rpb25zIjogW3sic2NoZW1hX25hbWUiOiAiUGVyc29uIiwgImlzc3Vlcl9kaWQiOiAiTDZBU2ptRERiREg3eVBMMXQyeUZqOSJ9LCB7InNjaGVtYV9uYW1lIjogIlBlcnNvbiIsICJpc3N1ZXJfZGlkIjogIlFFcXVBSGtNMzV3NFhWVDNLdTV5YXQifSwgeyJzY2hlbWFfbmFtZSI6ICJQZXJzb24iLCAiaXNzdWVyX2RpZCI6ICJNNmRodUZqNVV3YmhXa1NMbXZZU1BjIn1dLCAibm9uX3Jldm9rZWQiOiB7ImZyb20iOiAxNzE4NzQwMzE0LCAidG8iOiAxNzE4NzQwMzE0fX19LCAicmVxdWVzdGVkX3ByZWRpY2F0ZXMiOiB7fSwgIm5vbmNlIjogIjExMTYxNzY0NDU2MDk1NTE4Mzc1NzUwMjAifQ=="
                            }
                        }
                    ]
                }
            }
        }
    ],
    "services": [
        {
            "recipientKeys": [
                "did:key:z6MkiyHJfTKAYHypgzVHAPzKxjw8Nknxsk8LNbP59zdikvPZ#z6MkiyHJfTKAYHypgzVHAPzKxjw8Nknxsk8LNbP59zdikvPZ"
            ],
            "routingKeys": null,
            "serviceEndpoint": "https://88db-23-16-82-223.ngrok-free.app",
            "id": "#inline",
            "type": "did-communication",
            "priority": 0
        }
    ]
}

@loneil loneil requested review from esune and Gavinok June 18, 2024 20:03
@loneil loneil changed the title Generate an OOB invitation with a pres req Fix Out-Of-Band invitation option for QR codes Jun 18, 2024
@loneil loneil mentioned this pull request Jun 18, 2024
@loneil loneil force-pushed the bugfix/oobGeneration branch from f48fa22 to 4fc2a7d Compare June 18, 2024 20:19
@loneil loneil merged commit fcf2489 into main Jun 20, 2024
5 checks passed
@loneil loneil deleted the bugfix/oobGeneration branch June 20, 2024 18:26
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

Successfully merging this pull request may close these issues.

OOB format problem
2 participants