<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [UserAgentClient](./sip.js.useragentclient.md) &gt; [authenticationGuard](./sip.js.useragentclient.authenticationguard.md)

## UserAgentClient.authenticationGuard() method

If a 401 (Unauthorized) or 407 (Proxy Authentication Required) response is received, the UAC SHOULD follow the authorization procedures of Section 22.2 and Section 22.3 to retry the request with credentials. https://tools.ietf.org/html/rfc3261\#section-8.1.3.5 22 Usage of HTTP Authentication https://tools.ietf.org/html/rfc3261\#section-22 22.1 Framework https://tools.ietf.org/html/rfc3261\#section-22.1 22.2 User-to-User Authentication https://tools.ietf.org/html/rfc3261\#section-22.2 22.3 Proxy-to-User Authentication https://tools.ietf.org/html/rfc3261\#section-22.3

FIXME: This "guard for and retry the request with credentials" implementation is not complete and at best minimally passable.

<b>Signature:</b>

```typescript
protected authenticationGuard(message: IncomingResponseMessage): boolean;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  message | <code>IncomingResponseMessage</code> |  |

<b>Returns:</b>

`boolean`

True if the program execution is to continue in the branch in question. Otherwise the request is retried with credentials and current request processing must stop.

