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: <OAUHT_EXTENSION_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);
      });

To find the “clientId”, install the “SSI OAuth Extension” to your service, then add it to the desired interaction. Click on the installed “SSI OAuth Extension” in the interaction. The first line will be “clientId.”

To find the “serviceDid”, go to the “Service Info” page. The first line on the new page will be “Service Public DID.”

To find the “interactionId”, click the “Interactions” tab. One of the columns on the “Interactions” page is “ID.” Find the interaction where you added the “SSI OAuth Extension.”

To find the “instanceId”, click on the “Interactions” tab. On the new page, click on the desired interaction’s name. Then, on the “Interactions/YOUR_INTERACTION_NAME” page, select the “Instances” tab and choose the Interaction Instance ID.

  1. Both start and startWithSSIOAuth has 3 parameters:

start(element, config, preFilledCredentials)

where

  • element - HTMLDivElement to show QR code (or button in case mobile device)
    If you want to use popOverMode, then element must contain some visible elements like button or image 

  • config - structure

...