<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionConfiguration/urlCredentialStorage",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLSessionConfiguration(py)URLCredentialStorage"
  },
  "title" : "urlCredentialStorage"
}
-->

# urlCredentialStorage

A credential store that provides credentials for authentication.

```
var urlCredentialStorage: URLCredentialStorage? { get set }
```

## Discussion

This property determines the credential storage object used by tasks within sessions based on this configuration.

If you don’t want to use a credential store, set this property to `nil`.

For default and background sessions, the default value is the [`shared`](/documentation/Foundation/URLCredentialStorage/shared) credential store object.

For [`ephemeral`](/documentation/Foundation/URLSessionConfiguration/ephemeral) sessions, the default value is a private credential store object that stores data in memory only, and is destroyed when you invalidate the session.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)