***

title: validate
slug: /reference/typescript/agents/configuration/auth-handler/validate
description: Validate request headers against all configured authentication methods.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Validate request headers against configured auth methods (Bearer, API Key,
Basic, Custom) in order. Returns `true` if any configured method accepts
the request, or if no methods are configured and `allowUnauthenticated`
is not `false`.

## **Parameters**

<ParamField path="headers" type="Record<string, string>" required={true} toc={true}>
  The request headers as a string-keyed record. The method checks both
  lowercase and title-case header names (e.g., `authorization` and
  `Authorization`).
</ParamField>

## **Returns**

`Promise<boolean>` -- `true` if the request is authorized.

## **Example**

```typescript {8-10}
import { AuthHandler } from '@signalwire/sdk';

const auth = new AuthHandler({
  bearerToken: 'my-secret-token',
});

// Validate headers from an incoming request
const isValid = await auth.validate({
  authorization: 'Bearer my-secret-token',
});
console.log('Authorized:', isValid); // true
```