> For the complete documentation index, see [llms.txt](https://docs.witnesschain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.witnesschain.com/infinity-watch/apis/campaign-apis/authentication.md).

# Authentication

The **pre-login** and **login APIs** are crucial for the security and functionality of the Proof of Bandwidth or Proof of Location system. The APIs handles initial authentication steps, like generating session tokens and validating access. These APIs are foundational for safeguarding the prover's information and controlling system access, ensuring only authenticated users can interact with critical resources

Start the process by performing a **pre-login** and **login** requesttart the process by performing a **pre-login** and **login** request

{% hint style="info" %}
**Note:** The `{proof_type}` parameter is crucial in all API requests and **must** be set to one of the following values:

* `pol` (Proof of Location) -> Currently supported
* `pob` (Proof of Bandwidth)

{% endhint %}

#### Pre-login

{% openapi src="/files/WWLjK2RiH8JZs6E8BepB" path="/proof/v1/{proof\_type}/pre-login" method="post" %}
[challenge\_api.json](https://651400886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaZ7PXq43vesxvXxlBG9x%2Fuploads%2FSxD3akB7T6Vy6Ek6wdcA%2Fchallenge_api.json?alt=media\&token=45395a70-77eb-498b-8209-c4ae4f512011)
{% endopenapi %}

#### Login

After the result is obtained, the **/login** api needs to be invoked

{% openapi src="/files/WWLjK2RiH8JZs6E8BepB" path="/proof/v1/{proof\_type}/login" method="post" %}
[challenge\_api.json](https://651400886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaZ7PXq43vesxvXxlBG9x%2Fuploads%2FSxD3akB7T6Vy6Ek6wdcA%2Fchallenge_api.json?alt=media\&token=45395a70-77eb-498b-8209-c4ae4f512011)
{% endopenapi %}
