@mattrglobal/verifier-sdk-web 2.0.3-unstable.8 → 2.0.3-unstable.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -109,7 +109,7 @@ MATTRVerifierSDK.initialize({ apiBaseUrl, applicationId });
|
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
- `apiBaseUrl` (required): URL of the MATTR VII verifier tenant.
|
|
112
|
-
- `applicationId` (required): Unique identifier of the verifier application. This must match the [`id`](https://learn.mattr.global/api-reference/latest/tag/
|
|
112
|
+
- `applicationId` (required): Unique identifier of the verifier application. This must match the [`id`](https://learn.mattr.global/api-reference/latest/tag/Verifier-applications#operation/postVerifierApplication!c=201&path=0/id&t=response) parameter in the response returned when [creating a Verifier application](https://learn.mattr.global/api-reference/latest/tag/Verifier-applications#operation/postVerifierApplication) on the MATTR VII verifier tenant.
|
|
113
113
|
|
|
114
114
|
## Prepare a credential query
|
|
115
115
|
|
|
@@ -183,14 +183,14 @@ This behavior can be explicitly overridden by specifying the desired mode in the
|
|
|
183
183
|
|
|
184
184
|
## Define wallet identifiers
|
|
185
185
|
|
|
186
|
-
You can define an identifier of a specific wallet you want to invoke with this verification request. The identifier defined by the SDK in the credential request must match one of the identifiers
|
|
187
|
-
* If an identifier is provided and matches the `id` of one of the objects in the `walletProviders` array, the verifier tenant will invoke that specific wallet using its corresponding [`authorizationEndpoint`](https://learn.mattr.global/api-reference/latest/tag/
|
|
186
|
+
You can define an identifier of a specific wallet you want to invoke with this verification request. The identifier defined by the SDK in the credential request must match one of the identifiers of a [wallet provider](https://learn.mattr.global/api-reference/latest/tag/Wallet-providers#operation/postWalletProvider!path=name&t=request) created on the MATTR VII verifier tenant.
|
|
187
|
+
* If an identifier is provided and matches the `id` of one of the objects in the `walletProviders` array, the verifier tenant will invoke that specific wallet using its corresponding [`authorizationEndpoint`](https://learn.mattr.global/api-reference/latest/tag/Wallet-providers#operation/postWalletProvider!path=openid4vpConfiguration/authorizationEndpoint&t=request).
|
|
188
188
|
* If an identifier is provided and does not match the `id` of any of the objects in the `walletProviders array`, the request will fail.
|
|
189
189
|
* If an identifier is not provided, the verifier tenant will use `mdoc-openid4vp://` (default OID4VP scheme) to invoke any wallet.
|
|
190
190
|
|
|
191
191
|
## Configure redirectUri
|
|
192
192
|
|
|
193
|
-
When using the same-device presentation flow, the SDK must define what URI to redirect the user to once they complete the verification workflow in their wallet app. This can be any URI (including custom URI schemes), and must match one of the values defined in the [`redirectUris` array](https://learn.mattr.global/api-reference/latest/tag/
|
|
193
|
+
When using the same-device presentation flow, the SDK must define what URI to redirect the user to once they complete the verification workflow in their wallet app. This can be any URI (including custom URI schemes), and must match one of the values defined in the [`redirectUris` array](https://learn.mattr.global/api-reference/latest/tag/Verifier-applications#operation/postVerifierApplication!path=0/openid4vpConfiguration/redirectUris&t=request) when creating a verifier application.
|
|
194
194
|
|
|
195
195
|
# Request credentials examples
|
|
196
196
|
|
|
@@ -199,7 +199,7 @@ When using the same-device presentation flow, the SDK must define what URI to re
|
|
|
199
199
|
```javascript
|
|
200
200
|
MATTRVerifierSDK.initialize({ apiBaseUrl, applicationId }); // Initialize the SDK
|
|
201
201
|
const result = await MATTRVerifierSDK.requestCredentials({
|
|
202
|
-
credentialQuery:
|
|
202
|
+
credentialQuery: credentialQuery, // Define what credential query to use
|
|
203
203
|
challenge: MATTRVerifierSDK.utils.generateChallenge(), // Pass a unique challenge
|
|
204
204
|
openid4vpConfiguration: {
|
|
205
205
|
walletProviderId, // Define the wallet identifier
|
|
@@ -216,16 +216,16 @@ if (result.isErr()) {
|
|
|
216
216
|
* `apiBaseUrl` : Replace with the [`tenant_url`](https://learn.mattr.global/docs/platform-management/authentication) of your MATTR VII verifier tenant.
|
|
217
217
|
* `credentialQuery`: The credential query to be used in the request.
|
|
218
218
|
* `challenge`: The challenge that will be passed to the MATTR VII tenant with the request to create a presentation session. This example uses the SDK built-in method to generate the challenge, but you can replace it with a challenge generated by your backend system.
|
|
219
|
-
* `walletProviderId`: Replace with a wallet identifier that matches one of the
|
|
219
|
+
* `walletProviderId`: Replace with a wallet identifier that matches one of the identifiers of a [wallet provider](https://learn.mattr.global/api-reference/latest/tag/Wallet-providers#operation/postWalletProvider!path=name&t=request) created on the MATTR VII verifier tenant..
|
|
220
220
|
* `mode`: When omitted, the SDK defaults to automatically selecting a flow based on the browser's user agent (set to `undefined` in the example for clarity).
|
|
221
|
-
* `redirectUri` Replace with a URI that matches one of the values in the [`redirectUris` array](https://learn.mattr.global/api-reference/latest/tag/
|
|
221
|
+
* `redirectUri` Replace with a URI that matches one of the values in the [`redirectUris` array](https://learn.mattr.global/api-reference/latest/tag/Verifier-applications#operation/postVerifierApplication!path=0/openid4vpConfiguration/redirectUris&t=request) in the MATTR VII tenant's verifier application.
|
|
222
222
|
|
|
223
223
|
## Request credentials with explicit same-device flow
|
|
224
224
|
|
|
225
225
|
```javascript
|
|
226
226
|
MATTRVerifierSDK.initialize({ apiBaseUrl, applicationId });
|
|
227
227
|
const result = await MATTRVerifierSDK.requestCredentials({
|
|
228
|
-
credentialQuery:
|
|
228
|
+
credentialQuery: credentialQuery,
|
|
229
229
|
challenge: MATTRVerifierSDK.utils.generateChallenge(),
|
|
230
230
|
openid4vpConfiguration: {
|
|
231
231
|
redirectUri,
|
|
@@ -250,7 +250,7 @@ window.addEventListener("load", async () => {
|
|
|
250
250
|
```javascript
|
|
251
251
|
MATTRVerifierSDK.initialize({ apiBaseUrl, applicationId });
|
|
252
252
|
const result = await MATTRVerifierSDK.requestCredentials({
|
|
253
|
-
credentialQuery:
|
|
253
|
+
credentialQuery: credentialQuery,
|
|
254
254
|
challenge: MATTRVerifierSDK.utils.generateChallenge(),
|
|
255
255
|
openid4vpConfiguration: {
|
|
256
256
|
walletProviderId,
|
|
@@ -259,9 +259,9 @@ const result = await MATTRVerifierSDK.requestCredentials({
|
|
|
259
259
|
});
|
|
260
260
|
|
|
261
261
|
if (result.isErr()) {
|
|
262
|
-
console.info("<<< MATTRVerifierSDK.requestCredentials
|
|
262
|
+
console.info("<<< MATTRVerifierSDK.requestCredentials failure", result.error);
|
|
263
263
|
} else {
|
|
264
|
-
console.info("<<< MATTRVerifierSDK.requestCredentials
|
|
264
|
+
console.info("<<< MATTRVerifierSDK.requestCredentials succeed", result.value);
|
|
265
265
|
}
|
|
266
266
|
```
|
|
267
267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattrglobal/verifier-sdk-web",
|
|
3
|
-
"version": "2.0.3-unstable.
|
|
3
|
+
"version": "2.0.3-unstable.9+248865f2",
|
|
4
4
|
"main": "dist/lib/verifier-js.cjs.js",
|
|
5
5
|
"types": "dist/typings/index.d.ts",
|
|
6
6
|
"module": "dist/verifier-js.production.esm.js",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"docs": "rm -rf generatedDoc/ && typedoc && cp CHANGELOG_PUBLIC.md generatedDoc/CHANGELOG.md",
|
|
31
31
|
"docs:html": "NAME=\"MATTR Verifier Web SDK\" ../../scripts/generateHtmlDocs.sh"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "248865f24ed2a560752e0a8327d3e2b16c5aa843"
|
|
34
34
|
}
|