decentralized-identity / wallet-and-credential-interactions

QR Codes and Button for Claiming and Sharing Credentials (and more!)
https://identity.foundation/wallet-and-credential-interactions/
Apache License 2.0
7 stars 5 forks source link

Unify the payload in the QR Code and in the Link's href #19

Open JaceHensley opened 3 years ago

JaceHensley commented 3 years ago

Right now the QR code's payload is the stringified JSON and the link's href contains a base64 encoded payload as a query parameter.

I think it would be better to have both contain the same payload. And if the payload of the QR code is a link then systems could recognize the uri schema and suggest apps that could handle it

Suggestion:

Make the link's href look like:

const data = {
  challengeTokenUrl: 'https://...',
  version: '...'
}
<a href={`waci:${window.btoa(JSON.stringify(data))}`} />

And the payload given to the QR code is the same:

const data = {
  challengeTokenUrl: 'https://...',
  version: '...'
}

<QR data={`waci:${window.btoa(JSON.stringify(data))}`} />

Now if the user scans a WACI QR code with their camera app they could go to the waci link and an app that handles waci requests can be opened.