Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/Foundation.framework |
Availability | Available in Mac OS X v10.2 with Safari 1.0 installed. Available in Mac OS X v10.2.7 and later. |
Companion guide | |
Declared in | NSURLAuthenticationChallenge.h |
NSURLAuthenticationChallenge encapsulates a challenge from a server requiring authentication from the client.
– initWithAuthenticationChallenge:sender:
– initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:
Returns the NSError object representing the last authentication failure.
- (NSError *)error
This method returns nil
if the protocol doesn’t use errors to indicate an authentication failure.
NSURLAuthenticationChallenge.h
Returns the NSURLResponse object representing the last authentication failure.
- (NSURLResponse *)failureResponse
This method will return nil
if the protocol doesn’t use responses to indicate an authentication failure.
NSURLAuthenticationChallenge.h
Returns an initialized NSURLAuthenticationChallenge object copying the properties from challenge, and setting the authentication sender to sender.
- (id)initWithAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge sender:(id < NSURLAuthenticationChallengeSender >)sender
NSURLAuthenticationChallenge.h
Returns an initialized NSURLAuthenticationChallenge object for the specified space using the credential, or nil
if there is no proposed credential.
- (id)initWithProtectionSpace:(NSURLProtectionSpace *)space proposedCredential:(NSURLCredential *)credential previousFailureCount:(NSInteger)count failureResponse:(NSURLResponse *)response error:(NSError *)error sender:(id < NSURLAuthenticationChallengeSender >)sender
The previous failure count is set to count. The response should contain the NSURLResponse for the authentication failure, or nil
if it is not applicable to the challenge. The error should contain the NSError for the authentication failure, or nil
if it is not applicable to the challenge. The object that initiated the authentication challenge is set to sender.
NSURLAuthenticationChallenge.h
Returns the receiver’s count of failed authentication attempts.
- (NSInteger)previousFailureCount
NSURLAuthenticationChallenge.h
Returns the proposed credential for this challenge.
- (NSURLCredential *)proposedCredential
This method will return nil
if there is no default credential for this challenge.
If the proposed credential is not nil
and returns YES
when sent the message hasPassword
, then the credential is ready to use as-is. If the proposed credential returns NO
for hasPassword
, then the credential provides a default user name and the client must prompt the user for a corresponding password.
NSURLAuthenticationChallenge.h
Returns the receiver’s protection space.
- (NSURLProtectionSpace *)protectionSpace
NSURLAuthenticationChallenge.h
Returns the receiver’s sender.
- (id < NSURLAuthenticationChallengeSender >)sender
The sender should be sent a useCredential:forAuthenticationChallenge:
, continueWithoutCredentialForAuthenticationChallenge:
or cancelAuthenticationChallenge:
when the client is finished processing the authentication challenge.
NSURLAuthenticationChallenge.h
© 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)