A server or an area on a server, commonly referred to as a realm, that requires authentication.
SDKs
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
class URLProtectionSpace : NSObject
Overview
A protection space defines a series of matching constraints that determine which credential should be provided. For example, if a request provides your delegate with a URLAuthentication
object that requests a client username and password, your app should provide the correct username and password for the particular host, port, protocol, and realm, as specified in the challenge’s protection space.
Note
This class has no designated initializer; its init
method always returns nil
. You must initialize this class by calling one of the initialization methods described in Creating a Protection Space.