AASA webcredentials: set up Password AutoFill and shared credentials
The webcredentials section of apple-app-site-association is what lets iOS offer your website's saved passwords and passkeys inside your app. The file, the entitlement, the text field settings, how to test it, why it fails, and the matching assetlinks.json entry for Android.
webcredentials is the section of the apple-app-site-association (AASA) file that ties your app to your website's saved sign-in details. With it, iOS suggests the passwords a person saved for your site when they open your app's sign-in screen, saves new passwords under your domain, and allows passkeys. It needs two matching halves: the app's ID in the file on your domain, and webcredentials:yourdomain.com in the app's Associated Domains entitlement.
It has nothing to do with opening links. That's the applinks section of the same file, covered in apple-app-site-association examples and errors.
What webcredentials turns on
Apple's documentation lists four services that use associated domains: shared web credentials, Universal Links, Handoff and App Clips. webcredentials is the first, and it drives three features:
| Feature | What the user sees | Needs webcredentials? |
|---|---|---|
| Password AutoFill suggestions | Your site's saved login appears above the keyboard on the app's sign-in screen | Yes, for suggestions tied to your domain |
| Strong password and saving | iOS suggests a strong password at sign-up and saves it for your domain | Yes. Apple says the system suggests one "in apps that have an associated domain" |
| Passkeys | The passkey sheet for creating an account or signing in | Yes, always |
For passkeys, Apple's documentation is direct: "You need to have an associated domain with the webcredentials service type when making a registration or assertion request; otherwise, the request returns an error."
Without the association, AutoFill still half-works. Apple says its heuristics give "some Password AutoFill support in most apps", and the key icon lets a person search all their saved passwords by hand. What's missing is the one-tap suggestion for your domain.
Step 1: add webcredentials to the AASA file
{
"webcredentials": {
"apps": ["ABCDE12345.com.example.app"]
}
}
- Each entry is an app ID:
<Application Identifier Prefix>.<Bundle Identifier>. The prefix is normally your team ID. appsis an array, so list every app that should share the site's logins, including a separate bundle identifier for a staging build if it signs in to the same domain.- There are no paths. Apple's documentation says
detailsapplies only toapplinks;webcredentialsis a list of apps and nothing else.
Most apps already have a file for Universal Links. Add the section next to it:
{
"applinks": {
"details": [
{
"appIDs": ["ABCDE12345.com.example.app"],
"components": [{ "/": "/*" }]
}
]
},
"webcredentials": {
"apps": ["ABCDE12345.com.example.app"]
}
}
The AASA generator has a webcredentials switch that adds the section and prints the matching Associated Domains lines.
Step 2: host it on the domain people sign in to
The file lives at:
https://example.com/.well-known/apple-app-site-association
The rules are the same as for Universal Links: HTTPS with a valid certificate, HTTP 200 and no redirect. Since iOS 14 devices don't fetch the file from your server; Apple's CDN does, so the server must be reachable from the public internet.
Choosing the domain matters more here than it does for links:
- Use the domain your website saves passwords under. If people sign in at
www.example.com, Safari saved their login for that site, and that's the domain to associate. - Each subdomain is separate. Apple's documentation says each one needs its own entry in the entitlement and its own file.
example.comdoesn't coverlogin.example.com. - For passkeys, the domain must be the relying party identifier your server uses.
Hosting details for common platforms are in how to host AASA and assetlinks.json on Vercel, Netlify, nginx and Cloudflare.
Step 3: add the domain to Associated Domains
In Xcode, open the target's Signing & Capabilities tab, add the Associated Domains capability and add:
webcredentials:example.com
No https://, no path. If the app also uses Universal Links, both lines sit side by side:
applinks:links.example.com
webcredentials:example.com
They can be different domains, and often are: links on a link domain, credentials on the main site.
A wildcard works too. Apple's documentation says a *. prefix matches subdomains for these services (App Clips excepted), so webcredentials:*.example.com covers subdomains using the file on the root domain.
Step 4: tell iOS what each field is
The association makes credentials available. The text fields decide whether iOS offers them. Set the content type on each field.
UIKit:
usernameField.textContentType = .username
passwordField.textContentType = .password
passwordField.isSecureTextEntry = true
// On the sign-up screen
newPasswordField.textContentType = .newPassword
codeField.textContentType = .oneTimeCode
SwiftUI:
TextField("Email", text: $email)
.textContentType(.username)
SecureField("Password", text: $password)
.textContentType(.password)
On your website, the matching HTML attributes are autocomplete="username", autocomplete="current-password" and autocomplete="new-password". They are what makes Safari save the login in the first place.
Two details from Apple's documentation:
- When the person picks a suggestion, iOS asks for Face ID or Touch ID, and your app becomes inactive for a moment. Don't tear down the sign-in screen in
applicationWillResignActive, or the fill has nothing to fill. - If your site has password rules, describe them with
passwordRuleson the new-password field so the suggested password is one your server accepts.
In React Native, TextInput has textContentType ("username", "password", "newPassword", "oneTimeCode") for iOS and autoComplete for Android.
Step 5: test it
- Use a device with AutoFill for passwords turned on in Settings. Apple says the suggestion bar appears only if at least one password is saved on the device and the AutoFill setting is on.
- In Safari, sign in to your website and save the password when asked.
- Install the app build that has the
webcredentialsentitlement. - Open the sign-in screen and tap the username field.
The bar above the keyboard should show the saved login for your domain. If it shows only the key icon, iOS hasn't linked the app to the site.
Apple describes the timing in its Password AutoFill workflow: when the app is installed, the system takes each domain from the entitlement, tries to download its association file, and enables AutoFill for that domain if the steps succeed. So the file must be correct before the app is installed. After fixing the file, delete the app and install it again.
While developing, skip Apple's CDN by adding the developer mode to the entitlement and turning on Associated Domains Development under Settings > Developer:
webcredentials:staging.example.com?mode=developer
Remove ?mode=developer before you release.
When the suggestion doesn't appear
| Symptom | Likely cause | Fix |
|---|---|---|
| Only the key icon shows | No association for this domain | Check the app ID in the file, the entitlement spelling, then reinstall |
Works on example.com, not on app.example.com |
Subdomains are separate | Add the subdomain to the entitlement and host a file there, or use a wildcard |
| Worked in debug, fails in TestFlight | A different bundle identifier or team prefix | List every app ID in apps |
| File looks right, still nothing | Apple's CDN can't fetch it, or has an old copy | Check for redirects and firewalls; Apple says the CDN requests the file within 24 hours and devices check about weekly |
| Nothing above the keyboard at all | No saved password, or AutoFill is off | Save a login in Safari first; check the device's AutoFill settings |
| Passkey request returns an error | No webcredentials association for the relying party domain |
Associate the exact domain your server uses as the relying party ID |
| The fields don't fill | Content types missing, or the screen is removed when the app goes inactive | Set textContentType; keep the view in place |
The AASA validator checks that the file is reachable, served correctly and valid JSON.
Reading and saving credentials in code
AutoFill needs no code beyond the content types. If you want to ask for the saved login yourself, for example to sign the person in on launch, ASAuthorizationPasswordProvider presents the system sheet with the passwords saved for your associated domains, and it can share one ASAuthorizationController request with a passkey request. Apple's Shared Web Credentials documentation describes the older Security framework functions for storing and requesting these credentials, and notes that access "requires permission from the app, the website, and the user". The association you set up above is the app's and the website's part.
The Android equivalent
Android uses assetlinks.json for the same job. Google's Credential Manager documentation says Digital Asset Links are required for passkeys and strongly recommended for passwords. Add the get_login_creds relation next to the one for App Links:
[
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "android_app",
"package_name": "com.example.app",
"sha256_cert_fingerprints": ["AA:BB:…"]
}
}
]
Host it at https://<sign-in domain>/.well-known/assetlinks.json with Content-Type: application/json, HTTP 200 and no redirect. For passwords, the same guide adds an asset_statements meta-data entry in the manifest that points to the file. The generator linked above has a get_login_creds switch that adds the second relation.
FAQ
What is webcredentials in apple-app-site-association?
It's the section that lists which apps may use the passwords and passkeys saved for that website. iOS uses it for Password AutoFill suggestions, saving new passwords and passkey requests.
Do I need webcredentials for Universal Links?
No. Universal Links use the applinks section. Add webcredentials only if you want AutoFill suggestions for your domain or use passkeys.
Can applinks and webcredentials be in the same file?
Yes. One file per domain holds every service, and the app lists each service on its own line in Associated Domains.
Does webcredentials support paths?
No. It's a plain list of app IDs. Only applinks has details and path components.
Why does Password AutoFill show only the key icon?
iOS hasn't associated the app with a domain that has a saved login. Check that the app ID in the file matches the build, that the entitlement has webcredentials: with the right domain, and reinstall the app.
Where CodeOnAir fits
CodeOnAir AppLinks hosts the association file for your link domain and includes both applinks and webcredentials for your app there. Password AutoFill, though, follows the domain where people sign in, which is usually your own site, so that file stays on your server; the generator builds it. For the link side of Associated Domains, see the iOS SDK docs, and you can create a free account to try links: the Free plan includes 100 app links.
Checked on 16 November 2026 against Apple's documentation on supporting associated domains, the Associated Domains entitlement, Password AutoFill, the Password AutoFill workflow, Shared Web Credentials and passkeys, and Android's Credential Manager prerequisites.