@mattrglobal/verifier-sdk-web 1.1.1-unstable.9 → 1.1.1-unstable.91
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,11 +109,11 @@ MATTRVerifierSDK.initialise({ apiBaseUrl, applicationId });
|
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
- `apiBaseUrl` (required): URL of the MATTR VII verifier tenant.
|
|
112
|
-
- `applicationId` (optional): Unique identifier of the verifier application. This must match the [`
|
|
112
|
+
- `applicationId` (optional): Unique identifier of the verifier application. This must match the [`id`](https://learn.mattr.global/api-reference/latest/tag/mDocs-verification#operation/postVerifierApplication!c=200&path=id&t=response) parameter in the response returned when [creating a Verifier application configuration](https://learn.mattr.global/api-reference/latest/tag/mDocs-verification#operation/postVerifierApplication) on the MATTR VII verifier tenant.
|
|
113
113
|
|
|
114
114
|
## Prepare a credential query
|
|
115
115
|
|
|
116
|
-
The following example credential query will request the `
|
|
116
|
+
The following example credential query will request the `given_name`, `family_name`, `birth_date` and `portrait` claims from a `mobile` credential profile with `org.iso.18013.5.1.mDL` as a docType:
|
|
117
117
|
|
|
118
118
|
```javascript
|
|
119
119
|
const credentialQuery = [
|
|
@@ -122,7 +122,13 @@ const credentialQuery = [
|
|
|
122
122
|
"docType": "org.iso.18013.5.1.mDL",
|
|
123
123
|
"nameSpaces": {
|
|
124
124
|
"org.iso.18013.5.1": {
|
|
125
|
-
"
|
|
125
|
+
"given_name": {
|
|
126
|
+
"intentToRetain": false
|
|
127
|
+
},
|
|
128
|
+
"family_name": {
|
|
129
|
+
"intentToRetain": false
|
|
130
|
+
},
|
|
131
|
+
"birth_date": {
|
|
126
132
|
"intentToRetain": false
|
|
127
133
|
},
|
|
128
134
|
"portrait": {
|
|
@@ -136,9 +142,23 @@ const credentialQuery = [
|
|
|
136
142
|
}
|
|
137
143
|
];
|
|
138
144
|
```
|
|
139
|
-
|
|
145
|
+
* `profile`: Credential format of the credential that will be verified. Currently only mobile (mDocs) is supported.
|
|
146
|
+
* `docType`: the mDL’s type. Confirm with the certificate issuer for what docType they are issuing. Some common examples include:
|
|
147
|
+
* Mobile Driver Licence (`org.iso.18013.5.1.mDL`).
|
|
148
|
+
* PhotoID (`org.iso.23220.photoid.1`).
|
|
149
|
+
* Mobile Vehicle Registration Card (`org.iso.7367.1.mVRC`).
|
|
150
|
+
* Health certificate (`org.micov.vtr.1`).
|
|
151
|
+
* `nameSpaces`: Each namespace corresponds to a group of claims included in the credential. These can be claims that are part of a specific standard, jurisdiction or any other reference. The namespace would usually correspond to the requested `docType`.
|
|
152
|
+
* `intentToRetain` (Optional): When set to `true`, the holder will be indicated that the verifier intends to retain this claim beyond the verification workflow. Defaults to `false` when not specified.
|
|
153
|
+
|
|
140
154
|
> The API supports including multiple query objects in the `credentialQuery` array in a single request. For simplicity, this example only includes a single query object.
|
|
141
155
|
|
|
156
|
+
In this example the `credentialQuery` query will request for the `birthdate`, `portrait` and `resident_postal_code` claims from any credentials whose `profile` is `mobile` and `docType` is `org.iso.18013.5.1.mDL`.
|
|
157
|
+
|
|
158
|
+
It also sets `intentToRetain` as `false` for all claims, indicating to the holder that the verifier will not retain any of these claims.
|
|
159
|
+
|
|
160
|
+
> While `intentToRetain` defaults to false, it is explicitly set to `false` in the example above for clarity purposes. If there is no intention to retain a claim, it is sufficient to simply exclude `intentToRetain` from the query.
|
|
161
|
+
|
|
142
162
|
## Generate challenge
|
|
143
163
|
|
|
144
164
|
The Verifier Web SDK passes a unique challenge to the MATTR VII verifier tenant with every request to create a new presentation session. The purpose of the challenge is to ensure the security and integrity of the credential verification process by preventing replay attacks and verifying the authenticity of each request and response. You can either:
|
|
@@ -170,7 +190,7 @@ You can define an identifier of a specific wallet you want to invoke with this v
|
|
|
170
190
|
|
|
171
191
|
## Configure redirectUri
|
|
172
192
|
|
|
173
|
-
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/latest/tag/mDocs-verification#operation/
|
|
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/mDocs-verification#operation/postVerifierApplication!path=openid4vpConfiguration/redirectUris&t=request) in the MATTR VII tenant's verifier configuration.
|
|
174
194
|
|
|
175
195
|
# Request credentials examples
|
|
176
196
|
|
|
@@ -193,12 +213,12 @@ const result = await MATTRVerifierSDK.requestCredentials({
|
|
|
193
213
|
},
|
|
194
214
|
});
|
|
195
215
|
```
|
|
196
|
-
* `apiBaseUrl` : Replace with the [`tenant_url`](https://learn.mattr.global/docs/
|
|
216
|
+
* `apiBaseUrl` : Replace with the [`tenant_url`](https://learn.mattr.global/docs/platform-management/authentication) of your MATTR VII verifier tenant.
|
|
197
217
|
* `credentialQuery`: The credential query to be used in the request.
|
|
198
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.
|
|
199
219
|
* `walletProviderId`: Replace with a wallet identifier that matches one of the values in the [`walletProviders` array](https://learn.mattr.global/api-reference/latest/tag/mDocs-verification#operation/putVerifierConfiguration!path=walletProviders/id&t=request) of the MATTR VII tenant's verifier configuration.
|
|
200
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).
|
|
201
|
-
* `redirectUri` Replace with a URI that matches one of the values in the [`redirectUris` array](https://learn.mattr.global/latest/tag/mDocs-verification#operation/
|
|
221
|
+
* `redirectUri` Replace with a URI that matches one of the values in the [`redirectUris` array](https://learn.mattr.global/api-reference/latest/tag/mDocs-verification#operation/postVerifierApplication!path=openid4vpConfiguration/redirectUris&t=request) in the MATTR VII tenant's verifier application configuration.
|
|
202
222
|
* `crossDeviceCallback`: Defines how to handle completion (`onComplete`) or failure (`onFailure`) of the verification workflow.
|
|
203
223
|
|
|
204
224
|
## Request credentials with explicit same-device flow
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattrglobal/verifier-sdk-web",
|
|
3
|
-
"version": "1.1.1-unstable.
|
|
3
|
+
"version": "1.1.1-unstable.91+604dd3dd",
|
|
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": "604dd3dd31f619ba7da5c76074d2f878c0ee3418"
|
|
34
34
|
}
|