Age verification system

Made easy

Configuration
Example implementation
Color theme

Body area

Buttons

Verify age using a redirect

By clicking the button below a new browser tab will open with the age verification page using your config data above. The verification result will be posted back to your verification result callback url if it's already defined.

Verify age using the iframe

By clicking the button below a screen overlay will open with the age verification page using your config data above. The verification result will be posted back to your verification result callback url if it's already defined. Since we are using the javascript implementation, we will also listen to the events we receive while the detection it's running and we will log it in the area below.

Implementation guide
Selfie age verification

The selfie age verification check needs webcam access in order to scan in real time the face of the user. So the user must provide this access in order for the verification to run. During the verification the user will be asked to keep his face close to the center of the screen in order for the machine learning model to be able to perform the face extraction and the prediction task. Go.cam runs locally, on device, no images are sent to the server or stored during this process.

The age prediction is based on multiple shots of the users face from which an average age is calculated after the detected outliers are excluded. Besides the age evaluation, the face similatity is checked during the detection to be sure the same person is in front of the camera at all times. At the end of the verification, if the user is detected as an adult, he will also be asked to smile or stop smiling, depending on his current face expression, as a measure of liveness detection.

If the user is detected as an minor, the verification process will automatically redirect him to the ID document verification to confirm his age. During the ID verification the face shots from the previous steps are compared with the one from the document as a first step. Then if the face matching is correct the birth date will be extracted from the document and the age will be calculated based on that.

If the user is detected as an adult after the selfie age or the ID document verification process, he will be marked as verified. Otherwise the process can be retried, for a period of 10 minutes, the current session will expire after that so the process must pe restarted from the start.

Hint: Go.cam is "Challenge 25" certified, meaning that anyone who is over 18 but looks under 25 should carry acceptable ID document to validate his age.

Authorities that already certified us are:

For the age verification task Go.cam uses a implementation of a open source facial recognition model, you can find more about it here.

 

ID documents verification

As a first step of this verification, the user will be asked to select from a list of countries and document types to match the document he is planning to provide as proof. Currently Go.cam supports documents from all European countries and the United States of America. The supported types of documents are: ID card, passport and driver license.

The ID documents verification check can be done with the help of a webcam or by loading locally a image of a valid document. The user is not forced to provide webcam access, if he denies it he will be asked to browse for a image as default. Taking a photo with the webcam or selecting a local one will not trigger an upload of the image, like the age verification, the process will run locally.

In the case of a ID document verification that is not preceded by a selfie age verification, the face of the person on the document will not be checked. The birthdate of the document will be extracted and the current age of the user will be calculated. Based on the country or state the document is from, there is also a age majority check done. A verification success is triggered if the detected age is greater than the majority age.

For the document birthdate extraction task Go.cam uses a implementation of a open source OCR model, you can find more about it here.

Redirect flow

In the redirect flow, the verification process is done in a new window. The user is presented with a locked page and link that points to a verification URL. Once the verification process is complete, the user is presented with a additional link to return back to the initial page. This return link does not contain any information about the result of the verification, the result it's sent using a server to server call. The implementer should keep track of this callback and render the unlocked page when the user is sent back.

Here is a walkthrough of the process:

The user visits a site which is guarded by an age verification system

The user click on a button to start the age verification process

The implementer provides the "cypher key" to the Go.cam SDK together with some user data like a "user id" to generate a age verification URL

The user will be redirected to a URL on Go.cam where the verification process starts

Depending on the type of verification the user will have to allow access to his webcam for scanning his face or select a ID document image for processing

Once the verification is complete, the user will be presented with a success or failure page:

  • The success page will contain a button to return to the implementer site
  • The failure page will contain a "Retry" button so he can try again

The verification results will be saved on Go.cam

Go.cam will forward the verification results also to you defined "verification result callback url" together with the user data you defined like a "user id" so the implementer can mark the user as verified

Additionally, a cookie is created on Go.cam containing a encrypted version of some of the verification results that can be decrypted on a future visit, using your encryption keys "cypher key"

When the success button is clicked, the user will be redirected to the "link back" URL, the implementer site should be unlocked

 

Iframe overlay flow

In the iframe overlay flow, the verification process is done in a iframe overlay over the current page. The user is presented with a locked page and button that triggers a verification process overlay. Once the verification process is complete, the user is presented with a additional button to close the verification overlay. In this case the current page can communicate with the verification overlay, so once the process will end with success there will be a success event triggered, the result it's also sent using a server to server call. The implementer should keep track of the overlay events in order to render the unlocked page when these arrive.

Here is a walkthrough of the process:

The user visits a site which is guarded by a age verification system

The user click on a button to start the age verification process

The implementer provides the "cypher key" to the Go.cam SDK together with some user data like a "user id" to generate a age verification URL

The implementer uses also the frontend SDK to create a Go.cam verification instance and trigger the iframe overlay loading process

Once the iframe is loaded there will be an event announcing it, additionally if the iframe detects that a verification cookie was already set on Go.cam a different event will be triggered to announce it (in this case a verification is no longer needed usually but a cookie integrity check must be performed)

Depending on the type of verification the user will have to allow access to his webcam for scanning his face or select a ID document image for processing

Once the verification is complete, the user will be presented with a success or failure page:

  • The success page will contain a button to close the iframe overlay
  • The failure page will contain a "Retry" button so he can try again

The verification results will be saved on Go.cam

Go.cam will forward the verification results also to you defined "verification result callback url" together with the user data you defined like a "user id" so the implementer can mark the user as verified

Additionally, a cookie is created on Go.cam containing a encrypted version of some of the verification results that can be decrypted on a future visit, using your encryption keys "cypher key"

Finally, a javascript event will be triggered to announce the verification success which can be used optionally as a trigger to verify the cookie integrity saved in the previous step

When the success button is clicked, the iframe overlay is removed and the implementer site should be unlocked

Javascript events:

AvsJsSdk.V1.Config.EVENT_ON_CHECK_IFRAME_LOADED

This is the first event that is triggered by the iframe, it's triggered when the iframe document is ready.

AvsJsSdk.V1.Config.EVENT_STATUS_REQUEST
Request the age verification iframe the status of the cookie, works only on the initial verification phase.

AvsJsSdk.V1.Config.EVENT_ON_INITIAL_VERIFICATION_SUCCESS

The verification cookie it's already present on the user's browser due to a previous successful verification process.

AvsJsSdk.V1.Config.EVENT_ON_INITIAL_VERIFICATION_NOT_FOUND
The verification cookie was not found, meaning the user did not yet completed a successful verification process.

AvsJsSdk.V1.Config.EVENT_RESOURCE_PRELOAD

Request the age verification iframe to start loading the verification phase and it's needed resources.

AvsJsSdk.V1.Config.EVENT_ON_INITIAL_VERIFICATION_FATAL_ERROR

The specified access keys were incorrect or the go.cam resources failed to load.

AvsJsSdk.V1.Config.EVENT_ON_START_PAGE_LOADED
The age verification page document it's ready, the resources are still loading.

AvsJsSdk.V1.Config.EVENT_ON_RESOURCES_LOADED

The age verification page resources finished to load.

AvsJsSdk.V1.Config.EVENT_ON_CLOSE_IFRAME

The iframe overlay close button was clicked.

AvsJsSdk.V1.Config.EVENT_ON_VERIFICATION_SUCCESS
The age verification process was completed with success.

AvsJsSdk.V1.Config.EVENT_ON_VERIFICATION_ERROR

The age verification process was completed with error.

It's used to send back the age verification result to your server. The data we send back contains the status of the verification together with some additional data relevant to the age detection process (eg: custom user id, error codes, detection step, device type ...). So if you plan to validate the user by it's id or collect some basic statistics this callback url can help.

Post back data example:

array( 'userData' => array( 'colorConfig' => array( 'body' => array( 'background' => '#900', 'foreground' => '#fff', 'button' => array( 'background' => '#fb0', 'foreground' => '#333', 'foregroundCallToAction' => '#700', ) ) ) ), 'state' => 'success', 'stateInt' => 2, 'sessionId' => 12345, 'errorCode' => 0, 'deviceType' => 1, 'stepId' => 2, 'websiteHostname' => 'your-site-name.cam', 'ip' => '127.0.0.1', )

Explanation:

'state' => 'success'
Possible value Meaning
success the verification was successful
fail the verification failed
'stateInt' => 2
Possible value Meaning
0 unknown
1 Test not started or aborted
2 Success
3 Failed
4 Link expired
5 Link already used
'sessionId' => 12345
Possible value Meaning
12345 Verification session id
'errorCode' => 0
Possible value Meaning
0 No error
25001 Device it is not supported
25032 Preloading verification resources failed (face api resources)
25033 Preloading verification resources failed (tesseract resources)
25034 Could not retrieve your device camera list (selfie detection camera selection step)
25055 Could not detect enough faces from the device video (age detected is 0)
25056 Face similarity check fail (all selfie faces comparison)
25057 Could not detect enough faces from the device video (0 faces detected)
25061 Could not detect enough faces from the device video (expression check fail)
25062 Face similarity check fail (expression faces comparison)
25047 Webcam initialization error (selfie detection step)
25035 Failed to initialize detection libraries (selfie detection step -> face api detector)
25036 Failed to initialize detection libraries (selfie detection step -> face api age model)
25037 Failed to initialize detection libraries (selfie detection step -> face api recognition model)
25038 Failed to initialize detection libraries (selfie detection step -> face api landmarks model)
25058 Failed to initialize detection libraries (selfie detection step -> face api expression model)
25039 Could not retrieve your device camera list (scan id detection camera selection step)
25040 Failed to initialize detection libraries (scan id detection step -> tesseract worker)
25041 Failed to initialize detection libraries (scan id detection step -> tesseract language model)
25042 Failed to initialize detection libraries (scan id detection step -> tesseract language init)
25043 Failed to initialize detection libraries (scan id detection step -> tesseract worker config)
25044 Failed to initialize detection libraries (scan id detection step -> face api detector)
25045 Failed to initialize detection libraries (scan id detection step -> face api recognition model)
25051 Failed to extract a face from your identity card
25052 Selfie face does not match the one found on the identity card
25053 Detected age is lower than 18 years (scan id detection step)
25054 Failed to extract your age from the current identity card
25046 Webcam initialization error (scan id detection step)
20002 Test max allowed time expired (test success callback)
20004 Invalid step id (test success callback)
20000 Invalid token (test success callback)
20034 Invalid xcore api curl response (test success callback)
20003 Test max allowed time expired (test fail callback)
20005 Invalid step id (test fail callback)
20001 Invalid token (test fail callback)
20035 Invalid xcore api curl response (test fail callback)
18001 Credit card verification internal error
18002 Credit card verification maxmind error
'deviceType' => 1
Possible value Meaning
0 unknown
1 mobile
2 desktop
'stepId' => 2
Possible value Meaning
0 Test not started or aborted
1 Start page
2 Selfie detection camera selection
3 Selfie detection
4 Scan id camera selection
5 Scan id detection
6 Credit card verification intro
7 Credit card verification page
'idCountry' => 'FR'
Possible value Meaning
FR Country short code of the document the user selected to provide for the verification
'idState' => 'TX'
Possible value Meaning
TX State short code of the document the user selected to provide for the verification
'idType' => '1'
Possible value Meaning
1 Id card
2 Passport
3 Driver licence
'websiteHostname' => 'your-site-name.cam'
Possible value Meaning
your-site-name.cam Host name from where the test was initiated
'ip' => '127.0.0.1'
Possible value Meaning
127.0.0.1 Ip from where the test was initiated