Contents

CFHTTPMessageApplyCredentialDictionary(_:_:_:_:)

Use a dictionary containing authentication credentials to perform the authentication method specified by a CFHTTPAuthentication object.

Declaration

func CFHTTPMessageApplyCredentialDictionary(_ request: CFHTTPMessage, _ auth: CFHTTPAuthentication, _ dict: CFDictionary, _ error: UnsafeMutablePointer<CFStreamError>?) -> Bool

Parameters

  • request:

    The request for which the authentication method is to be performed.

  • auth:

    A CFHTTPAuthentication object specifying the authentication method to perform.

  • dict:

    A dictionary containing authentication credentials to be applied to the request. For information on the keys in this dictionary, see Cfhttpauthentication.

  • error:

    If an error occurs, upon return contains a doc://com.apple.documentation/documentation/corefoundation/cfstreamerror object that describes the error and the error’s domain. Pass NULL if you don’t want to receive error information.

Return Value

TRUE if the authentication was successful, otherwise, FALSE.

Discussion

This function performs the authentication method specified by auth on behalf of the request specified by request using the credentials contained in the dictionary specified by dict. The dictionary must contain values for the kCFHTTPAuthenticationUsername and kCFHTTPAuthenticationPassword keys. If CFHTTPAuthenticationRequiresAccountDomain(_:) returns TRUE for auth, the dictionary must also contain a value for the kCFHTTPAuthenticationAccountDomain key.

Special Considerations

This function is thread safe as long as another thread does not alter the same CFHTTPAuthentication object at the same time.

See Also

HTTP Messages