<!--
{
  "availability" : [
    "iOS: 9.0.0 - 18.0.0",
    "iPadOS: 9.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.11.0 - 15.0.0",
    "tvOS: 17.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NWTCPConnectionAuthenticationDelegate/shouldProvideIdentity(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(pl)NWTCPConnectionAuthenticationDelegate(im)shouldProvideIdentityForConnection:"
  },
  "title" : "shouldProvideIdentity(for:)"
}
-->

# shouldProvideIdentity(for:)

Indicate that the delegate can provide an identity for the connection authentication.

```
optional func shouldProvideIdentity(for connection: NWTCPConnection) -> Bool
```

## Parameters

`connection`

The connection sending this message.

## Return Value

Return <doc://com.apple.documentation/documentation/Swift/true> to provide the identity for this connection, in which case the delegate method [`provideIdentity(for:completionHandler:)`](/documentation/NetworkExtension/NWTCPConnectionAuthenticationDelegate/provideIdentity(for:completionHandler:)) will be called.

## Discussion

The caller can implement this optional protocol method to decide whether it wants to provide the identity for this connection for authentication. If this delegate method is not implemented, the return value will default to YES if [`provideIdentity(for:completionHandler:)`](/documentation/NetworkExtension/NWTCPConnectionAuthenticationDelegate/provideIdentity(for:completionHandler:)) is implemented.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)