Class NSURLAuthentication Challenge
A challenge from a server requiring authentication from the client.
iOS 2.0+ macOS 10.2+ Mac Catalyst 13.0+ tvOS 9.0+ watchOS 2.0+ Declaration @interface NSURLAuthenticationChallenge :
Your app receives authentication challenges in various
, NSURLSession , and NSURLConnection delegate methods, such as NSURLDownload . These objects provide the information you’ll need when deciding how to handle a server’s request for authentication. URLSession: task: did Receive Challenge: completion Handler:
At the core of that authentication challenge is a
protection space that defines the type of authentication being requested, the host and port number, the networking protocol, and (where applicable) the authentication realm (a group of related URLs on the same server that share a single set of credentials). Topics Creating an Authentication Challenge Instance Inspecting the Authentication Challenge Getting Properties of Previous Authentication Attempts failure Response
The URL response object representing the last authentication failure.
Getting Authentication Errors error
The error object representing the last authentication failure.
The sender of the challenge.
See Also Authentication and Credentials NSURLCredential
n authentication credential consisting of information specific to the type of credential and the type of persistent storage to use, if any.
A NSURLProtection Space
A server or an area on a server, commonly referred to as a realm, that requires authentication.