Skip to content

Commit 0d4d11f

Browse files
committed
updated readme
1 parent 83292f8 commit 0d4d11f

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
This project demonstrates a secure face authentication flow using Incode's WebSDK with proper validation and session management. The application implements:
44

5-
- **User hint input** for authentication (customerId, email, or phone)
5+
- **User hint input** for authentication (identityId)
66
- **Face authentication** using Incode's renderAuthFace SDK
7-
- **Session management** with IndexedDB to prevent reuse
87
- **Backend validation** to verify authentication integrity by:
98
- Matching candidate from the SDK with identityId from the score API
10-
- Validating overall authentication status
11-
- Preventing token tampering and session replay attacks
12-
- Marking sessions as used to prevent reuse
9+
- Validating overall status to be OK
10+
- Closing sessions to prevent modification
1311

1412
This example showcases best practices for implementing face authentication in a web application with proper security measures.
1513

@@ -61,7 +59,7 @@ sequenceDiagram
6159

6260
# Requirements
6361

64-
Vite requires Node.js version 14.18+, 16+. some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.
62+
Vite 8 requires **Node.js ^20.19.0 || >=22.12.0**. Run `node -v` to verify before installing.
6563

6664
# Install
6765

@@ -83,24 +81,22 @@ VITE_FAKE_BACKEND_FLOW_ID=
8381

8482
Remember the Flow holds the backend counter part of the process, some configurations there might affect the behavior of the WebSDK here.
8583

86-
# Fake Backend Server
84+
# Example Backend
8785

8886
Starting and finishing the session must be done in the backend. To simplify development, this
89-
sample includes a `fake_backend.js` file that handles backend operations in the frontend.
87+
sample includes an `example_backend.js` file that handles backend operations in the frontend.
9088

9189
**Important:** Replace this with a proper backend for production. The API key should NEVER be exposed in the frontend.
9290

9391
## Key Backend Functions
9492

95-
- `fakeBackendStart()` - Creates a new session and stores it in IndexedDB with `used: false`
96-
- `fakeBackendFinish()` - Retrieves the finish status from the API
97-
- `fakeBackendGetScore()` - Gets the authentication score from the API
98-
- `fakeBackendValidateAuthentication()` - Validates the authentication by:
99-
- Checking if the session exists and hasn't been used
100-
- Verifying the token matches the stored token
101-
- Comparing candidate with identityId from the score
102-
- Ensuring overall status is "OK"
103-
- Marking the session as used to prevent reuse
93+
- `start(identityId)` - Calls Incode's `/omni/start` API to create a new session and returns the session `token`
94+
- `getResults(token, candidate)` - Verifies the authentication by:
95+
- Finishing the session via `/omni/finish-status` to trigger score calculation
96+
- Closing the session via `/omni/session/status/set?action=Closed` to freeze the score
97+
- Retrieving the score via `/omni/get/score`
98+
- Comparing `candidate` (from the WebSDK) with `identityId` from the score to prevent tampering
99+
- Checking that the overall score status is "OK"
104100

105101
# Run
106102

0 commit comments

Comments
 (0)