Function

CFHTTPAuthenticationCreateFromResponse

Uses an authentication failure response to create a CFHTTPAuthentication object.

Declaration

CFHTTPAuthenticationRef CFHTTPAuthenticationCreateFromResponse(CFAllocatorRef alloc, CFHTTPMessageRef response);

Parameters

alloc

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

response

Response indicating an authentication failure; usually a 401 or a 407 response.

Return Value

CFHTTPAuthentication object that can be used for adding credentials to future requests. Ownership follows the The Create Rule.

Discussion

This function uses a response containing authentication failure information to create a reference to a CFHTTPAuthentication object. You can use the object to add credentials to future requests. You can query the object to get the following information:

When you have determined what information will be needed to perform the authentication and accumulated that information, call CFHTTPMessageApplyCredentials or CFHTTPMessageApplyCredentialDictionary to perform the authentication.

See Also

HTTP Authentication

CFHTTPAuthenticationRef

An opaque reference representing HTTP authentication information.

CFHTTPAuthenticationAppliesToRequest

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

CFHTTPAuthenticationCopyDomains

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

CFHTTPAuthenticationCopyMethod

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

CFHTTPAuthenticationCopyRealm

Gets an authentication information’s namespace.

CFHTTPAuthenticationGetTypeID

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

CFHTTPAuthenticationIsValid

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

CFHTTPAuthenticationRequiresAccountDomain

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

CFHTTPAuthenticationRequiresOrderedRequests

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

CFHTTPAuthenticationRequiresUserNameAndPassword

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

kCFHTTPAuthenticationAccountDomain

Account domain to use for authentication.

kCFHTTPAuthenticationPassword

Password to use for authentication.

kCFHTTPAuthenticationSchemeBasic

Request the HTTP basic authentication scheme.

kCFHTTPAuthenticationSchemeDigest

Request the HTTP digest authentication scheme.

kCFHTTPAuthenticationSchemeKerberos

Request the HTTP Kerberos authentication scheme.

kCFHTTPAuthenticationSchemeNTLM

Request the HTTP NTLM authentication scheme.

kCFHTTPAuthenticationSchemeNegotiate

Request the HTTP Negotiate authentication scheme.

kCFHTTPAuthenticationSchemeNegotiate2

Request the HTTP Negotiate v2 authentication scheme.

kCFHTTPAuthenticationSchemeXMobileMeAuthToken

Request the HTTP XMobileMeAuthToken authentication scheme.

kCFHTTPAuthenticationUsername

Username to use for authentication.