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

# proposedCredential

The proposed credential for this challenge.

```
@NSCopying var proposedCredential: URLCredential? { get }
```

## Discussion

This method returns `nil` if there is no default credential for this challenge.

If you have previously attempted to authenticate and failed, this method returns the most recent failed credential.

If the proposed credential is not `nil` and returns <doc://com.apple.documentation/documentation/Swift/true> when you call its [`hasPassword`](/documentation/Foundation/URLCredential/hasPassword) method, then the credential is ready to use as-is. If the proposed credential’s [`hasPassword`](/documentation/Foundation/URLCredential/hasPassword) method returns <doc://com.apple.documentation/documentation/Swift/false>, then the credential provides a default user name, and the client must prompt the user for a corresponding password.

---

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)