Enumeration

URLCredential.Persistence

Constants that specify how long the credential will be kept.

Declaration

enum Persistence : UInt

Overview

In iOS, credentials are stored in the app’s keychain, and can be accessed only by that app (and other apps in the same keychain access group, where applicable).

In macOS, credentials are stored in the user’s keychain. The credential’s initial access control list (ACL) allows access only by that app. However, other apps can see that a password exists for a given host, port, and realm combination, and can request that the user grant permission to use that credential.

Topics

Persistence Strategies

case none

The credential should not be stored.

case forSession

The credential should be stored only for this session.

case permanent

The credential should be stored in the keychain.

case synchronizable

The credential should be stored permanently in the keychain, and in addition should be distributed to other devices based on the owning Apple ID.

See Also

Creating a Credential

init(identity: SecIdentity, certificates: [Any]?, persistence: URLCredential.Persistence)

Creates a URL credential instance for resolving a client certificate authentication challenge.

init(trust: SecTrust)

Creates a URL credential instance for server trust authentication, initialized with a accepted trust.

init(user: String, password: String, persistence: URLCredential.Persistence)

Creates a URL credential instance initialized with a given user name and password, using a given persistence setting.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software