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
Create an account for your business application on Inrupt's PodSpaces
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 GrantsRequirements
You need to know the resource owner's WebID.
You can find the
userWalletStorage
in the resource owner WebIDThe location of the resource you want to access.
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