Camera Permission Flow

In order to provide a better user experience we include a page that takes care of explaining why the camera permission must be granted, and to block the user attempt to authenticate or enroll if they have already denied the camera permission.

The underlying logic uses the Permissions query method to check if the user has granted the camera permission or not.

Note, this API is not supported by Firefox and some very old browsers, therefore we implemented a secondary flow to perform this check. In these instances the user will always see the camera permission page the first time they use the Web SDK on that website, but the check will still be performed in an elegant way. The result of this check will be stored in the cookies.

The camera permission page can always be skipped by setting the aforementioned cookie, we expose a function from the @keyless/sdk-web package called setKeylessCameraPermissionCookies which accepts an object with the following structure:

Key

Type

state

"denied" | "granted"

The cookie can also be manually set without using this function, the name of the cookie is kl-camera-permission_state and its options must be these ones:

Option

Value

Expires

Next Year Date

Path

"/"

SameSite

strict

Secure

true

It is highly recommended to use our setKeylessCameraPermissionCookies function.

Last updated