Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Library options
    ssi-auth-lib library shows QR for desktop browsers and Web-link button for mobile browsers to trigger the interaction. It has two options:

    1. Show QR/Web-link to trigger an interaction with QR initiation media selected.

    2. Show QR/Web-link to trigger an interaction with QR initiation media selected and support SSI OAuth flow configured on the dashboard for this particular interaction.

  2. Library can be included

    1. as builded bundle

      <script src="<path_to_lib>/wl.js"></script>

    2. or as npm library https://www.npmjs.com/package/ssi-auth-lib
      npm install ssi-auth-lib –save
      const ProofSpace = require(‘ssi-auth-lib’)

  3. Usage

    1. For the pure interaction without SSI OAuth flow

      Code Block
      languagetypescript
      ProofSpace.WebLinker.start(elem, {
       serviceDid: <YOUR_SERVICE_DID>,
       interactionId: <YOUR_OAUTH_ACTION_ID>,
       instanceId: <YOUR_OAUTH_INSTANCE_ID>,
       size: 300 // size of QR code in pixels
      }).then(() => {
       console.log(‘QR Initialized’);
      });

    2. For the interaction with SSI OAuth flow

      Code Block
      languagetypescript
      ProofSpace.WebLinker.startWithSSIOAuth(elem, {
       clientId: <CLIENT_ID>
       serviceDid: <YOUR_SERVICE_DID>,
       interactionId: <YOUR_OAUTH_ACTION_ID>,
       instanceId: <YOUR_OAUTH_INSTANCE_ID>,
       size: 300 // size of QR code in pixels
      }).then((result) => {
       console.log(result.access_token);
      });

Find the “clientId”

To find the “clientId”:

  1. Install the “SSI OAuth Extension” to your service (you can find steps to install an extension to your service on the “Integration options“ page).

  2. Add it to the desired interaction (You can find steps to do so on the “Integration options“ page).

  3. Click on the installed “SSI OAuth Extension” in the interaction.

The first line on the new page, will be “clientId.”

Extension ID-20240521-230447.png

Client ID-20240521-230836.png

Find your “serviceDid”

To find the “serviceDid”:

  1. Go to the “Service Info” page.

The first line on the new page will be “Service Public DID.”

Service DID-20240521-230803.png

Find the “interactionId”

To find the “interactionId”:

  1. Click the “Interactions” tab. One of the columns on the “Interactions” page called “ID.” Find the interaction where you added the “SSI OAuth Extension and copy it’s ID.”

interactionId-20240521-231454.png

Find the “instanceId”

To find the “instanceId”:

  1. Click the “Interactions” tab.

  2. On the new page, click on the desired interaction’s name.

  3. On the next page, select the “Instances” tab and choose the Interaction Instance ID.

Instance ID-20240521-231046.png

...