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

To find the “clientId”

...

:

  1. Install the “SSI OAuth Extension” to your service (here you can find steps to install an extension to your service

...

  1. ).

  2. Add it to the desired interaction (You can find steps to do so here).

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

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

--

To find the “serviceDid”

...

:

  1. Go to the “Service Info” page.

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

To find the “interactionId”

...

:

  1. Click the “Interactions” tab. One of the columns on the “Interactions” page

...

  1. called “ID.” Find the interaction where you added the “SSI OAuth Extension and copy it’s ID.”

hh

interactionId-20240521-231454.pngImage Added

To find the “instanceId”

...

:

  1. Click the “Interactions” tab.

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

...

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

kkk

bbb

  1. Both start and startWithSSIOAuth has 3 parameters:

...