---
title: "authenticateComponents:withData:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsconnectiondelegate/authenticatecomponents:withdata:"
---

# authenticateComponents:withData:

Returns a Boolean value that indicates whether given authentication data is valid for a given set of components.

## Declaration

```occ
- (BOOL) authenticateComponents:(NSArray *) components withData:(NSData *) signature;
```

## Parameters

- `components`: An array that contains NSData and NSPort objects belonging to an NSPortMessage object. See the doc://com.apple.foundation/documentation/Foundation/PortMessage class specification for more information.
- `signature`: Authentication data created by the delegate of the peer NSConnection object with doc://com.apple.foundation/documentation/Foundation/NSConnectionDelegate/authenticationDataForComponents:.

## Return Value

Return Value true if the signature provided is valid for components, otherwise false.

## Discussion

Discussion Use this message for validation of incoming messages. An NSConnection object raises an NSFailedAuthenticationException on receipt of a remote message the delegate doesn’t authenticate.

## See Also

### Related Documentation

- [Distributed Objects Programming Topics](apple-archive/documentation/Cocoa/Conceptual/DistrObjects.md)

### Authenticating

- [authenticationDataForComponents:](foundation/nsconnectiondelegate/authenticationdataforcomponents:.md)
