<!--
{
  "availability" : [
    "iOS: 8.0.0 - 14.0.0",
    "iPadOS: 8.0.0 - 14.0.0",
    "macCatalyst: 14.0.0 - 14.0.0",
    "macOS: 11.0.0 - 11.0.0",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecRequestSharedWebCredential(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecRequestSharedWebCredential"
  },
  "title" : "SecRequestSharedWebCredential(_:_:_:)"
}
-->

# SecRequestSharedWebCredential(_:_:_:)

Asynchronously obtains one or more shared passwords for a website.

```
func SecRequestSharedWebCredential(_ fqdn: CFString?, _ account: CFString?, _ completionHandler: @escaping (CFArray?, CFError?) -> Void)
```

## Parameters

`fqdn`

(Optional) The fully qualified domain name of the website for which passwords are being requested. If `NULL` is passed in this argument, the domain name(s) listed in the calling app’s <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.associated-domains> are searched implicitly.

`account`

(Optional) The account name for which passwords are being requested. The account may be `NULL` to request all of the shared credentials that are available for the site, allowing the caller to discover an existing account.

`completionHandler`

A block that is called to deliver the requested credentials.

    The block takes two arguments:

- `credentials`: An array containing the requested passwords. If no matching items are found, the credentials array is empty. The credentials reference is automatically released after this handler is called, though you may optionally retain it for as long as needed.
- `error`: If the shared password was successfully added (or removed), `NULL`; if not successful, a <doc://com.apple.documentation/documentation/CoreFoundation/CFError> object that encapsulates the reason why the password could not be added (or removed). The error reference is automatically released after this handler is called, though you may optionally retain it for as long as needed.

## Discussion

This function requests one or more shared passwords for a given website, depending on whether the optional account parameter is supplied. To obtain results, the website specified in the `fqdn` parameter must be one that matches an entry in the calling app’s <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.associated-domains>.

If matching shared password items are found, the credentials provided to the completion handler will be a <doc://com.apple.documentation/documentation/CoreFoundation/CFArray> data type containing <doc://com.apple.documentation/documentation/CoreFoundation/CFDictionary> entries. Each dictionary contains the following pairs:

|Key                                                                   |Value                                                                               |
|----------------------------------------------------------------------|------------------------------------------------------------------------------------|
|``doc://com.apple.security/documentation/Security/kSecAttrServer``    |<doc://com.apple.documentation/documentation/CoreFoundation/CFString> (the website) |
|``doc://com.apple.security/documentation/Security/kSecAttrAccount``   |<doc://com.apple.documentation/documentation/CoreFoundation/CFString> (the account) |
|``doc://com.apple.security/documentation/Security/kSecSharedPassword``|<doc://com.apple.documentation/documentation/CoreFoundation/CFString> (the password)|

If the found item specifies a nonstandard port number (other than 443 for `https`), the following key may also be present:

|``doc://com.apple.security/documentation/Security/kSecAttrPort``|<doc://com.apple.documentation/documentation/CoreFoundation/CFNumber> (the port number)|
|----------------------------------------------------------------|---------------------------------------------------------------------------------------|

> Note:
> Because a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called as soon as the results (if any) are available.

---

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)