# Challenge approval

If the user approves the challenge request with its **PKSA**, the latest will send a `challenge_ack` message to the **HAS** with an access token and its expiration.

When the **HAS** will receive the user approval from its **PKSA**, it will forward it to the **APP** which will receive the following message:

### challenge\_ack

```
{
    cmd: "auth_ack",
    uuid: string,
    data: string
}
```

{% tabs %}
{% tab title="Properties" %}

* **`uuid`**: the request identifier
* **`data`**: `challenge_ack_data` encrypted with the `auth_key` and converted to Base64
  {% endtab %}
  {% endtabs %}

The **APP** must validate the received `uuid` against the request ID (`uuid`) that it received from the **HAS** in the `challenge_wait` message and ignore the `challenge_ack` message if they don't match.

The **APP** must decrypt the `challenge_ack_data` object using the encryption key previously shared with the **PKSA** (`auth_key`). If the **APP** cannot decrypt and parse `challenge_ack_data`, the **APP** must ignore the `challenge_ack` message.

> This `challenge_ack_data` encryption/decryption process has been put in place to ensure that a malicious actor operating a **HAS** cannot bypass the **PKSA** to approve a challenge request.
>
> As the encryption key has been provided offline to the **PKSA**, the **HAS** has no access to it and is therefore unable to decrypt, tamper then (re-)encrypt any data exchanged between the **APP** and the **PKSA**.

The structure of the `challenge_ack_data` is:

### challenge\_ack\_data

```
{
    pubkey: string,
    challenge: string
}
```

{% tabs %}
{% tab title="Properties" %}

* **`pubkey`**: the account public key
* **`challenge`**: the signed challenge
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hiveauth.com/developer-documentation/has-for-applications/challenge/challenge-approval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
