# NSURLAuthenticationChallenge class documentation

Software documentation for the NSURLAuthenticationChallenge class
Foundation/NSURLAuthenticationChallenge.h
Class to represent an authentication challenge and indicate when the challenge is complete.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
error
Returns the error with which the reciver was initialised or `nil` if it was not initialised with an error.
The error may indicate the nature of the authentication failure.
failureResponse
Returns the response with which the receiver was initialised.
This response contains the authentication failure corresponding to this challenge object.
If there was no failure or response, returns `nil`.
initWithAuthenticationChallenge:
challenge
sender:
sender
Initialises a new challenge by copying information from an old one.
initWithProtectionSpace:
space
proposedCredential:
credential
previousFailureCount:
previousFailureCount
failureResponse:
response
error:
error
sender:
sender
Returns the receiver initialised in the specified protection space and with the specified credential. The previousFailureCount says how many requests have failed the challenge and response provide information about the last failure (which caused this challenge to be created).
The error provides information about the authentication failure and the sender is the object to receive callbacks.
previousFailureCount
Returns the count of failed authentication attempts.
proposedCredential
Returns a proposed credential to answer the challenge.
If there is no credential available, this returns `nil`.
The credential may come from storage or from the URL itsself.
protectionSpace
Returns the protection space needing authentication.
sender
Returns the sender of the challenge... the object to which callbacks should be made while processing the challenge.
Software documentation for the NSURLAuthenticationChallengeSender protocol
Foundation/NSURLAuthenticationChallenge.h
NSObject
A challenge sender (usually an NSURLProtocol subclass handling a connection/download) provides these methods to permit a client to control authentication.
cancelAuthenticationChallenge:
challenge
Cancels the authenticatiopn challenge, ensuring that the load operation will fail to retrieve data, completing with only the response headers containing the challenge having been read from the server.
continueWithoutCredentialForAuthenticationChallenge:
challenge
Tells the sender to continue the load without providing a new credential for it to use... if the challenge already had a proposed credential, the sender may elect to use it.
useCredential:
credential
forAuthenticationChallenge:
challenge
Tells the sender to continue the load using the new credential provided by this method.