pub unsafe extern "C-unwind" fn SecRequestSharedWebCredential(
fqdn: Option<&CFString>,
account: Option<&CFString>,
completion_handler: &DynBlock<dyn Fn(*const CFArray, *mut CFError)>,
)
SecSharedCredential
and block2
only.Expand description
Asynchronously obtain one or more shared passwords for a website.
Parameter fqdn
: (Optional) 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 application’s ‘com.apple.developer.associated-domains’ entitlement are searched implicitly.
Parameter account
: (Optional) Account name for which passwords are being requested. The account may be NULL to request all shared credentials which are available for the site, allowing the caller to discover an existing account.
Parameter completionHandler
: A block which will be called to deliver the requested credentials. If no matching items were found, the credentials array will be empty, and the CFErrorRef parameter will provide the error result. Note: the credentials and error references will be automatically released after this handler is called, though you may optionally retain either for as long as needed.
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 which matches an entry in the calling application’s ‘com.apple.developer.associated-domains’ entitlement.
If matching shared password items are found, the credentials provided to the completionHandler will be a CFArrayRef containing CFDictionaryRef entries. Each dictionary entry will contain the following pairs (see Security/SecItem.h): key: kSecAttrServer value: CFStringRef (the website) key: kSecAttrAccount value: CFStringRef (the account) key: kSecSharedPassword value: CFStringRef (the password)
If the found item specifies a non-standard port number (i.e. other than 443 for https), the following key may also be present: key: kSecAttrPort value: CFNumberRef (the port number)
Note: since 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 once the results (if any) are available.