CFHTTPAuthentication

The CFHTTPAuthentication opaque type provides an abstraction of HTTP authentication information.

Topics

Creating an HTTP authentication

func CFHTTPAuthenticationCreateFromResponse(CFAllocator?, CFHTTPMessage)

Uses an authentication failure response to create a CFHTTPAuthentication object.

CFHTTP Authentication Functions

This section describes the CFNetwork authentication functions that are used to manage authentication information associated with a request. The functions work with a CFHTTPAuthentication object, which is created from an HTTP response that failed with a 401 or 407 error code.

When you have analyzed the CFHTTPAuthentication object and acquired the necessary credentials to perform the authentication, call CFHTTPMessageApplyCredentials(_:_:_:_:_:) or CFHTTPMessageApplyCredentialDictionary(_:_:_:_:) to perform the authentication.

func CFHTTPAuthenticationAppliesToRequest(CFHTTPAuthentication, CFHTTPMessage)

Returns a Boolean value that indicates whether a CFHTTPAuthentication object is associated with a CFHTTPMessage object.

func CFHTTPAuthenticationCopyDomains(CFHTTPAuthentication)

Returns an array of domain URLs to which a given CFHTTPAuthentication object can be applied.

func CFHTTPAuthenticationCopyMethod(CFHTTPAuthentication)

Gets the strongest authentication method that will be used when a CFHTTPAuthentication object is applied to a request.

func CFHTTPAuthenticationCopyRealm(CFHTTPAuthentication)

Gets an authentication information’s namespace.

func CFHTTPAuthenticationIsValid(CFHTTPAuthentication, UnsafeMutablePointer<CFStreamError>?)

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

func CFHTTPAuthenticationRequiresAccountDomain(CFHTTPAuthentication)

Returns a Boolean value that indicates whether a CFHTTPAuthentication object uses an authentication method that requires an account domain.

func CFHTTPAuthenticationRequiresOrderedRequests(CFHTTPAuthentication)

Returns a Boolean value that indicates whether authentication requests should be made one at a time.

func CFHTTPAuthenticationRequiresUserNameAndPassword(CFHTTPAuthentication)

Returns a Boolean value that indicates whether a CFHTTPAuthentication object uses an authentication method that requires a username and a password.

Getting the CFHTTPAuthentication type ID

func CFHTTPAuthenticationGetTypeID()

Gets the Core Foundation type identifier for the CFHTTPAuthentication opaque type.

Data Types

class CFHTTPAuthentication

An opaque reference representing HTTP authentication information.

Constants

CFHTTP Authentication Scheme Constants

Specifies the authentication scheme when adding authentication information to a CFHTTP request message object.

enum CFStreamErrorHTTPAuthentication

Authentication error codes that may be returned when trying to apply authentication to a request.

See Also

Opaque Types

CFFTPStream

This document describes the CFStream functions for working with FTP connections. It is part of the CFFTP API.

CFHost

The CFHost API allows you to create instances of the CFHost object that you can use to acquire host information, including names, addresses, and reachability information.

CFHTTPMessage

The CFHTTPMessage opaque type represents an HTTP message.

CFNetDiagnostics

The CFNetDiagnostics opaque type allows you to diagnose network-related problems.

CFNetServices

The CFNetServices API is part of Bonjour, Apple’s implementation of zero-configuration networking (ZEROCONF). The CFNetServices API allows you to register a network service, such as a printer or file server, so that it can be found by name or browsed for by service type and domain. Applications can use the CFNetServices API to discover the services that are available on the network and to find all access information — such as name, IP address, and port number — needed to use each service.