Make your first Business Application

A business application allows companies to securely request, write to, and utilize data stored in users' wallets to provide valuable services.

Create an Account for the Business Application

  1. Create an account for your business application on Inrupt's PodSpaces

  2. Create Client Credentials after you create your account on https://login.inrupt.com/registration.html

Create an Access Request

Your business application will request data from your user wallet by sending an Access Request.

Access Grants

Requirements

  1. You need to know the resource owner's WebID.

  2. You can find the userWalletStorage in the resource owner WebID

  3. The location of the resource you want to access.

  4. Create a session for the business application.

import { issueAccessRequest } from "@inrupt/solid-client-access-grants";
    const vcData = await issueAccessRequest(
      {
        access: { read: true },
        resourceOwner: resourceOwner,
        resources: [userWalletStorage + '/wallet/text.txt'],
        expirationDate: new Date(Date.now() + 60 * 60 * 10000),
      },
      {
        fetch: businessSession.fetch,
      }
    );

Send the Access Request to the Inbox

const inboxUrl = new URL('inbox/', userWalletStorage).toString();
const vcId = vcData.id.substring('https://vc.inrupt.com/vc/'.length);

const verifiablePresentation = JSON.stringify({
  '@context': ['https://www.w3.org/2018/credentials/v1'],
  type: 'VerifiablePresentation',
  verifiableCredential: [vcData]
});

const response = await enterpriseSession.fetch(inboxUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Slug': vcId
  },
  body: verifiablePresentation
});

Last updated