Mac Developer Library

Developer

Foundation Framework Reference NSURLAuthenticationChallengeSender Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSURLAuthenticationChallengeSender

Inheritance


Not Applicable

Conforms To


Import Statement


Swift

import Foundation

Objective-C

@import Foundation;

Availability


Available in OS X v10.2 with Safari 1.0 installed.
Available in OS X v10.2.7 and later.

The NSURLAuthenticationChallengeSender protocol represents the interface that the sender of an authentication challenge must implement.

The methods in the protocol are generally sent by a delegate in response to receiving a connection:didReceiveAuthenticationChallenge: or download:didReceiveAuthenticationChallenge:. The different methods provide different ways of responding to authentication challenges.

  • Cancels a given authentication challenge. (required)

    Declaration

    Swift

    func cancelAuthenticationChallenge(_ challenge: NSURLAuthenticationChallenge)

    Objective-C

    - (void)cancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

    Parameters

    challenge

    The authentication challenge to cancel.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.2 with Safari 1.0 installed.

    Available in OS X v10.2.7 and later.

  • Attempt to continue downloading a request without providing a credential for a given challenge. (required)

    Declaration

    Swift

    func continueWithoutCredentialForAuthenticationChallenge(_ challenge: NSURLAuthenticationChallenge)

    Objective-C

    - (void)continueWithoutCredentialForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

    Parameters

    challenge

    A challenge without authentication credentials.

    Discussion

    This method has no effect if it is called with an authentication challenge that has already been handled.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.2 with Safari 1.0 installed.

    Available in OS X v10.2.7 and later.

  • Attempt to use a given credential for a given authentication challenge. (required)

    Declaration

    Swift

    func useCredential(_ credential: NSURLCredential, forAuthenticationChallenge challenge: NSURLAuthenticationChallenge)

    Objective-C

    - (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

    Parameters

    credential

    The credential to use for authentication.

    challenge

    The challenge for which to use credential.

    Discussion

    This method has no effect if it is called with an authentication challenge that has already been handled.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.2 with Safari 1.0 installed.

    Available in OS X v10.2.7 and later.

  • Causes the system-provided default behavior to be used.

    Declaration

    Swift

    optional func performDefaultHandlingForAuthenticationChallenge(_ challenge: NSURLAuthenticationChallenge)

    Objective-C

    - (void)performDefaultHandlingForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge

    Parameters

    challenge

    The challenge for which the default behavior should be used.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.7 and later.

  • Rejects the currently supplied protection space.

    Declaration

    Swift

    optional func rejectProtectionSpaceAndContinueWithChallenge(_ challenge: NSURLAuthenticationChallenge)

    Objective-C

    - (void)rejectProtectionSpaceAndContinueWithChallenge:(NSURLAuthenticationChallenge *)challenge

    Parameters

    challenge

    The challenge that should be rejected.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.7 and later.