
# Get Geolocation info

Geolocation is a verification that allows you to obtain the **real geographic location** of your users. 
In addition, you can configure the verification to **restrict the usage of VPN** services.

The data of the geolocation verification will be attached as a new property called `geolocation_device` 
in the _Identity Results endpoint_, following this format: `"<latitude>, <longitude>"`

{{<code lang="Json" method="GET" endpoint="api.identity.truora.com/v1/processes/{process_id}/result" lang_title="Response">}}
  {
    "process_id": "IDPxxxxxxx",
    "account_id": "ACCxxxxxxx",
    "client_id": "TCIxxxxxxx",
    "flow_id": "IPFxxxxxx",
    "created_via": "web",
    "flow_version": 1,
    "country": "ALL",
    "status": "success",
    "last_finished_step": {
        "step_id": "IPSxxxxxxx",
        "process_id": "",
        "verification_id": "VRFxxxxxxx",
        "is_deleted": false,
        "type": "enter_geolocation_permissions",
        "verification_output": {
            "status": "success",
            "outputs": [
                {
                    "value": "x.xxx, -x.xxx",
                    "name": "geolocation"
                },
                {
                    "value": "xxx.xxx.xxx.xx",
                    "name": "ip"
                }
            ],
            "media_uploaded": false,
            "step_data_received": true
        },
        "config": {
            "retries": 3,
            "timeout": 0
        },
        "expected_inputs": [
            {
                "type": "text",
                "value": "x.xxx, -x.xxx",
                "name": "geolocation",
                "placeholder": "Autorización de uso de la ubicación",
                "description": "",
                "length": 0,
                "read_only": false
            },
            {
                "type": "text",
                "value": "xxx.xxx.xxx.xx",
                "name": "ip",
                "placeholder": "Ingresa tu dirección IP",
                "description": "",
                "length": 0,
                "read_only": false
            }
        ],
        "files_upload_urls": null,
        "remaining_retries": 0,
        "async_step": null,
        "start_date": "2024-07-19T22:04:01.32626531Z",
        "finish_date": "2024-07-19T22:04:23.952142076Z"
    },
    "creation_date": "2024-07-19T22:04:01.320254135Z",
    "update_date": "2024-07-19T22:04:25Z",
    "ip_address": "xxx.xxx.xxx.xx",
    "geolocation_device": "x.xxx, -xx.xxx",
    "devices_info": [
        {
            "model": "xxx",
            "type": "xxx",
            "os": "xxx",
            "os_version": "xx.x.x",
            "browser": "xxxx",
            "browser_version": "xxx.x.x.x"
        }
    ],
    "trigger_info": {
        "channel_name": "web",
        "channel_type": "unknown",
        "id": "IPFxxxxx",
        "name": "flow_name",
        "message": "",
        "media_content_path": "",
        "trigger_user": "",
        "response": "",
        "options": null
    },
    "time_to_live": 120,
    "current_step_index": 1
}
{{</code>}}

## User Experience

Using this verification will require your users to grant location permissions at the beginning of the verification process, 
so they can continue with the rest of the verification steps.

<div align="center">
  <img width="45%" src=/images/illustrations/digital_identity/geolocation_permissions.png alt="Geolocation permissions" class="rounded-md"/>
</div>


If **VPN usage restriction** is enabled, and we detect that the user is using a VPN connection, we will block the process until the user turns off the VPN connection. 
The user will have 3 attempts to deactivate the VPN connection and retry the verification.

<div align="center">
  <img width="45%" src=/images/illustrations/digital_identity/vpn_detected.png alt="VPN detected" class="rounded-md"/>
</div>

## Flow Configuration

You can find the Geolocation block in the Advanced Blocks section of the Flow Builder, just for `Web and app` flows. 
Add this block to an already created process by following these steps:

1. Drag and drop the geolocation block.
2. Place it at the beginning of your process.
3. Attach the box with dots to the first block of your process.

<div align="center">
  <img src="/images/illustrations/digital_identity/geolocation_instrucctions.gif" alt="Geolocation instructions" class="rounded-md"/>
</div>

> Note: This block must precede the other verification blocks, except for the Data authorization block.

In the Properties section of the block, you can enable **VPN usage restriction**, that means that we will block users who are using some kind of Proxy / VPN provider.

> Note: VPN detection is free for now. We will notify you when there is an additional charge.

<img src="/images/illustrations/digital_identity/geolocation_and_vpn.png" alt="Geolocation and VPN detection" class="rounded-md"/>
