Affinidi Iota Framework configuration

Create an Affinidi Iota Framework configuration and its credential queries in Affinidi Portal, and test them against your own Affinidi Vault.

An Affinidi Iota Framework configuration sets how your website requests data from users: the wallet that signs each request, how the request and response travel, and the credential queries that describe the data you need.

Configuration details

Affinidi Portal asks for these fields in two steps. Name of configuration, Description of configuration, and Data sharing flow mode are on the first step, and the rest are on the second.

Required fields

  • Name of configuration: a name for your own reference, from 3 to 64 characters, shown only in Affinidi Portal.
  • Data sharing flow mode: how the request and the user’s response travel between your website and Affinidi Vault. See Data-sharing mode.
    • WebSockets, the default: your website receives the response over a WebSocket connection. This is the only mode you can test in Affinidi Portal.
    • Redirect: Affinidi Vault returns the user to your website with the response. Enter the Redirect URLs you allow, each on a new line.
  • Signing Wallet: the wallet that signs each request token. Keep Create New Wallet to create one, with an optional Name of wallet, or select an existing wallet. A new wallet uses did:key by default. See Wallets.
  • Integration Mode: where your users respond to data requests.
    • Affinidi Vault, the default: the Affinidi web vault. Affinidi Portal sets the Response Webhook URL for you, and credential queries use PEX.
    • Affinidi TDK Vault: a vault you embed in your own mobile or desktop app with the Affinidi TDK Vault library. Enter your app’s Response Webhook URL. Credential queries can use PEX or DCQL.
  • Lifetime of Request Token: how long a user has to complete a request, in minutes, from 1 to 10. The default is 10.

Optional fields

  • Description of configuration: what the configuration is for.

Under Requester Display Information (shown in holder wallet), set what users see when Affinidi Vault asks for their consent:

  • Display name: the name of your website or application.
  • Origin: the domain of your website.
  • Logo URL: your application’s logo.

Both options are selected by default:

Identity Verification flow

  • Enable Identity Verification (IDV): when the user has no verified identity credential in their Affinidi Vault, a third-party service guides them through verifying their identity, with a self-photo and a supported identity document.

The option appears under Requester Display Information for configurations in Redirect mode, once identity verification is enabled for your project. Add a credential query that requests the verified identity credential.

Create configuration

  1. In the Affinidi Elements section of the sidebar, go to Affinidi Iota Framework , and select Create configuration.
  2. Under Step 1 of 2: Configuration details, enter the Name of configuration, choose the Data sharing flow mode, and select Next step.
  3. Under Step 2 of 2: Configuration Details, choose the Signing Wallet and Integration Mode, and set the other fields you need.
  4. Select Create. Affinidi Portal opens the page of your new configuration.
Create Affinidi Iota Framework Configuration page at Step 2 of 2, with Create New Wallet as the signing wallet and Affinidi Vault as the integration mode

After creating your configuration, add the credential queries that request data from users. Manage them in the Credential queries section of the configuration’s page. Select Create Credential Query to add the first query, or Edit to change existing ones.

  1. Choose the Query Format:
    • PEX: a presentation definition in the Presentation Exchange format.
    • DCQL: the query language of the OpenID for Verifiable Presentations (OID4VP) standard. DCQL works with configurations whose Integration Mode is Affinidi TDK Vault. For a configuration that uses Affinidi Vault, choose PEX.
  2. Enter a Name for the query.
  3. Write the query, or start from a template with Load Query Template and change it to request the data you need.
  4. Select Add to create more queries.
  5. Select Save all changes.
Create Credential Query page with the DCQL query format selected and a query loaded from a template

Each credential query generates a Query ID. Use this ID to retrieve the query and generate a request token to access data from the user’s wallet.

Test your configuration

Test a configuration’s PEX queries against your own Affinidi Vault before you integrate. Testing works for configurations in WebSockets mode. For other modes, Test is unavailable.

  1. At the top of the configuration’s page, select Test.
  2. Check Holder’s DID:
    • Signed in to Affinidi Portal with Affinidi Login: the field is filled in with your Affinidi Vault’s DID.
    • Signed in with Apple, Google, GitHub, or Microsoft: copy the DID from your Affinidi Vault’s Settings page and paste it into the field. If you have no Affinidi Vault yet, select Create Vault first.
  3. Keep Mode set to Popup, or select New Tab if your browser blocks pop-ups.
  4. In Query, select a query, and select Send request. Affinidi Vault opens with the request.
  5. Consent to share the data. The Response column shows what your Affinidi Vault shared, next to the Request you sent.
Test Affinidi Iota Framework Configuration page with Holder's DID, Mode, Query, and the Request and Response columns

Testing shows whether your queries request the right data, and what your website will receive, before you integrate.

What’s next

  Implement consent-driven data-sharing flow on your website

  View data-sharing consent logs