Contents

URLAuthenticationChallenge

A challenge from a server requiring authentication from the client.

Declaration

class URLAuthenticationChallenge

Overview

Your app receives authentication challenges in various URLSession, NSURLConnection, and NSURLDownload delegate methods, such as urlSession(_:task:didReceive:completionHandler:). These objects provide the information you’ll need when deciding how to handle a server’s request for authentication.

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

Getting authentication errors

Legacy

Initializers

See Also

Authentication and credentials