Skip to content

Commit 1876b15

Browse files
authored
Merge pull request #298 from docknetwork/AgneCaunt-patch-1
Update biometric-plugin.md
2 parents 07f9371 + 8a41a7c commit 1876b15

File tree

2 files changed

+43
-20
lines changed

2 files changed

+43
-20
lines changed

docs/biometric-plugin.md

+34-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Purpose
1+
# Biometric Plugin
2+
3+
## Purpose
24

35
The biometrics plugin provides a way to perform credential verification using the user's biometric data. It is useful to guarantee that only the biometric holder can perform the verification.
46

5-
# How to trigger a biometric verification
7+
## How to trigger a biometric verification
68

79
To trigger a biometric verification, you need to use a verification template that asks for the biometric attributes. Check the following example:
810

@@ -51,8 +53,10 @@ The presence of the following fields should trigger the biometric check:
5153
}
5254
```
5355

54-
# How to enable the biometric plugin in the wallet
56+
## How to enable the biometric plugin in the wallet
57+
5558
To enable the biometric plugin in a white-label wallet, you need to edit the following file src/wallet-sdk-configs.ts and add your configuration:
59+
5660
```typescript
5761
import { BiometricsPluginConfigs } from "@docknetwork/wallet-sdk-react-native/lib/default-biometrics-plugin";
5862
export const biometricsPluginConfigs: BiometricsPluginConfigs = {
@@ -71,29 +75,44 @@ export const biometricsPluginConfigs: BiometricsPluginConfigs = {
7175

7276
```
7377

78+
## Credential expiration
7479

75-
# Credential expiration
7680
Credential expiration allows the biometric service provider to specify a maximum length to the validity of a biometric check credential. If the verifier wants to force a refresh of the biometric check more frequently, the verifier can check the credential creation timestamp during verification to ensure it’s within their business rules.
7781

78-
# Credential types
82+
## Credential types
83+
7984
This plugin uses two types of credentials to perform the biometric verification:
8085

81-
- Enrollment Credential: This optional credential contains the biometric data of the user. The biometric data is stored in the credential subject field and will be used to perform the biometric match.
82-
- Biometric Match Credential: This credential is issued by the biometric plugin after the biometric match. It contains the biometric ID, the issuer, and the creation date. The verifier can use this credential to check if the biometric match was performed recently and by the same issuer, and it will not contain any biometric data.
86+
* Enrollment Credential: This optional credential contains the biometric data of the user. The biometric data is stored in the credential subject field and will be used to perform the biometric match.
87+
* Biometric Match Credential: This credential is issued by the biometric plugin after the biometric match. It contains the biometric ID, the issuer, and the creation date. The verifier can use this credential to check if the biometric match was performed recently and by the same issuer, and it will not contain any biometric data.
88+
89+
## How to bind a biometric to a credential
8390

84-
# How to bind a biometric to a credential
8591
Before issuing a credential, the issuer may request to verify the biometric check credential. If a valid credential does not exist, the wallet will trigger the biometric plugin to confirm the biometric and issue a credential.
8692

87-
The biometric check credential needs a unique binding ID that can only be generated by that specific user. The issuer can then include in the primary credential the biometric ID and biometric issuer as attributes that bind that credential to that holder's biometric.
93+
The biometric check credential needs a unique binding ID that can only be generated by that specific user. The issuer can then include in the primary credential, the biometric ID and biometric issuer as attributes that bind that credential to that holder's biometric.
8894

8995
At the time of verification, the verifier can request the biometric check credential along with the primary credential. If the biometric check credential is recent enough, from the same issuer, and contains the same biometric ID, then the verifier can know it is the same holder presenting the credential.
9096

91-
The biometric ID should not contain the user's actual biometric information. When enrolling a holder in the biometric service, it might be useful to issue an enrollment credential containing the biometric template, the generated biometric ID, and any other needed information to identify a returning user. This credential can be verified to get the user's information before checking their biometric. By storing this information with the holder, it avoids the biometric service having to store that PII outside of the control of the holder. The holder should only share a biometric enrollment credential with the biometric service that issued it.
97+
The biometric ID should not contain the user's actual biometric information. When enrolling a holder in the biometric service, it might be useful to issue an enrolment credential containing the biometric template, the generated biometric ID and any other needed information to identify a returning user. This credential can be verified to get the user's information before checking their biometric. By storing this information with the holder, it avoids the biometric service having to store that PII outside of the control of the holder. The holder should only share a biometric enrollment credential with the biometric service that issued it.
98+
99+
## Using the Biometric Service Plugin
100+
101+
* Create a [Dock API key](../../dock-certs/creating-api-keys-and-webhook-endpoints.md)
102+
* Wrap the Dock API in your mobile API (which is usually protected with an app username / password)
103+
* When a specific install does a biometric check, call your mobile API to issue a biometric credential
104+
* The biometric binding nested attributes in the primary credential should include the ecosystem and biometric issuer alongside the biometric ID
105+
* Your mobile API calls the Dock API to do issuance to the DID
106+
* In order to use the ecosystem definition of the credentials, the Dock API should be used to query the ecosystem that is found in the credential for the “\*biometric check” schema
107+
* Mobile API should include the DID that the credential is pushed to
108+
* This allows the biometric check credential to be managed in the ecosystem where other participants can rely on it and VPI can be enforced
109+
* Biometric Service Plugin monitors credentials received. When a new biometric check credential is received, old ones can be deleted from wallet storage.
110+
* If biometric data should not leave the device, then the biometric service provider plugin can do a local verification of the biometric enrollment credential using the credential SDK. The biometric enrollment credential is managed independent from the ecosystem, as it should only be verified by the biometric provider.
92111

93-
# Adding a custom biometric provider
94-
Adding a custom biometric provider will require the development of the plugin following the interface defined at packages/react-native/lib/default-biometrics-plugin.ts. The plugin should implement the following methods:
112+
## Adding a custom biometric provider
95113

96-
- hasProofOfBiometrics: Checks if the verification template is asking for biometric attributes.
97-
- enrollBiometrics: Enrolls the biometric data.
98-
- matchBiometrics: Performs the biometric match and if it is valid, returns a biometric match credential. It will try to reuse an existing biometric match credential if it is still valid, otherwise it will remove the expired credential and issue a new one.
114+
Adding a custom biometric provider will require the development of the plugin following the interface defined at [packages/react-native/lib/default-biometrics-plugin.ts](https://github.com/docknetwork/react-native-sdk/blob/master/packages/react-native/lib/default-biometrics-plugin.ts). The plugin should implement the following methods:
99115

116+
* hasProofOfBiometrics: Checks if the verification template is asking for biometric attributes.
117+
* enrollBiometrics: Enrolls the biometric data.
118+
* matchBiometrics: Performs the biometric match and if it is valid, returns a biometric match credential. It will try to reuse an existing biometric match credential if it is still valid, otherwise it will remove the expired credential and issue a new one.

docs/ecosystem-tools.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Ecosystem Tools
2+
23
You can find the implementation of ecosystem tools in the following location:
34

4-
File Path: packages/core/src/ecosystem-tools.ts
5+
File Path: [packages/core/src/ecosystem-tools.ts](https://github.com/docknetwork/react-native-sdk/blob/5dfbcb197b848802478d2f7a697286a8c3c28823/packages/core/src/ecosystem-tools.ts#L4)
6+
57
## Usage Example
8+
69
Below is an example demonstrating how to use getEcosystems to retrieve ecosystem information based on an issuer's DID.
710

8-
Importing the Function
9-
First, ensure you import getEcosystems from the SDK:
11+
Importing the Function First, ensure you import getEcosystems from the SDK:
1012

1113
```js
1214
import {getEcosystems} from '@docknetwork/wallet-sdk-core/src/ecosystem-tools';
@@ -26,6 +28,7 @@ fetchEcosystemDetails();
2628
```
2729

2830
## Expected Output
31+
2932
When you run the above code, you should expect an output similar to this:
3033

3134
```json
@@ -37,10 +40,11 @@ When you run the above code, you should expect an output similar to this:
3740
}
3841
}
3942
```
43+
4044
This JSON output contains the details of the ecosystems associated with the given issuerDID.
4145

4246
## Integration Tests
47+
4348
For more examples and usage, please refer to the integration test at:
4449

45-
Test File Path: integration-tests/ecosystem-tools.test.ts
46-
This test file provides comprehensive examples on how to interact with ecosystem tools effectively.
50+
Test File Path: https://github.com/docknetwork/react-native-sdk/blob/master/integration-tests/ecosystem-tools.test.ts This test file provides comprehensive examples on how to interact with ecosystem tools effectively.

0 commit comments

Comments
 (0)