@mattrglobal/verifier-sdk-web 1.1.1-unstable.3 → 1.1.1-unstable.30
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:
|
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.30+ab345c4f",
|
|
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": "ab345c4f3e9be8c134a5df991a4d595792d3953d"
|
|
34
34
|
}
|