---
title: "CFHTTPAuthenticationIsValid(_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfhttpauthenticationisvalid(_:_:)"
---

# CFHTTPAuthenticationIsValid(_:_:)

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

## Declaration

```swift
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

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

## Discussion

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(_:_:_:_:_:) and CFHTTPMessageApplyCredentialDictionary(_:_:_:_:). If this function returns FALSE, auth is invalid, and authentications using it will not succeed.

## See Also

### HTTP Authentication

- [CFHTTPAuthentication](cfnetwork/cfhttpauthentication.md)
- [CFHTTPAuthenticationAppliesToRequest(_:_:)](cfnetwork/cfhttpauthenticationappliestorequest(_:_:).md)
- [CFHTTPAuthenticationCopyDomains(_:)](cfnetwork/cfhttpauthenticationcopydomains(_:).md)
- [CFHTTPAuthenticationCopyMethod(_:)](cfnetwork/cfhttpauthenticationcopymethod(_:).md)
- [CFHTTPAuthenticationCopyRealm(_:)](cfnetwork/cfhttpauthenticationcopyrealm(_:).md)
- [CFHTTPAuthenticationCreateFromResponse(_:_:)](cfnetwork/cfhttpauthenticationcreatefromresponse(_:_:).md)
- [CFHTTPAuthenticationGetTypeID()](cfnetwork/cfhttpauthenticationgettypeid().md)
- [CFHTTPAuthenticationRequiresAccountDomain(_:)](cfnetwork/cfhttpauthenticationrequiresaccountdomain(_:).md)
- [CFHTTPAuthenticationRequiresOrderedRequests(_:)](cfnetwork/cfhttpauthenticationrequiresorderedrequests(_:).md)
- [CFHTTPAuthenticationRequiresUserNameAndPassword(_:)](cfnetwork/cfhttpauthenticationrequiresusernameandpassword(_:).md)
- [kCFHTTPAuthenticationAccountDomain](cfnetwork/kcfhttpauthenticationaccountdomain.md)
- [kCFHTTPAuthenticationPassword](cfnetwork/kcfhttpauthenticationpassword.md)
- [kCFHTTPAuthenticationSchemeBasic](cfnetwork/kcfhttpauthenticationschemebasic.md)
- [kCFHTTPAuthenticationSchemeDigest](cfnetwork/kcfhttpauthenticationschemedigest.md)
- [kCFHTTPAuthenticationSchemeKerberos](cfnetwork/kcfhttpauthenticationschemekerberos.md)
