<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFHTTPAuthenticationIsValid(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@F@CFHTTPAuthenticationIsValid"
  },
  "title" : "CFHTTPAuthenticationIsValid(_:_:)"
}
-->

# CFHTTPAuthenticationIsValid(_:_:)

Returns a Boolean value that indicates whether a CFHTTPAuthentication object is valid.

```
func CFHTTPAuthenticationIsValid(_ auth: CFHTTPAuthentication, _ error: UnsafeMutablePointer<CFStreamError>?) -> Bool
```

## Parameters

`auth`

The CFHTTPAuthentication object to examine.

`error`

Pointer to a <doc://com.apple.documentation/documentation/CoreFoundation/CFStreamError> structure, whose fields, if an error has occurred, are set to the error and the error’s domain.

## Return Value

`TRUE` if `auth` contains enough information to be applied to a request.

## Discussion

If this function returns `FALSE`, the CFHTTPAuthentication object may still contain useful information, such as the name of an unsupported authentication method.

## Discussion

If this function returns `TRUE` for `auth`, the object is good for use with functions such as [`CFHTTPMessageApplyCredentials(_:_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageApplyCredentials(_:_:_:_:_:)) and [`CFHTTPMessageApplyCredentialDictionary(_:_:_:_:)`](/documentation/CFNetwork/CFHTTPMessageApplyCredentialDictionary(_:_:_:_:)). If this function returns `FALSE`, `auth` is invalid, and authentications using it will not succeed.

---

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)