凭据管理器常见问题解答
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页中的问题及解答旨在帮助您更好地理解凭据管理器的实现细节。
您的反馈对于改进 Credential Manager API 至关重要。您可以通过以下链接分享发现的任何问题或改进 API 的想法:
提供反馈
集成
为什么还需要另一个 Jetpack 库来进行应用身份验证?
Jetpack 凭据管理器库可在所有 Android 版本之间打造统一的登录体验。此外,您还可以通过它更加及时地获得最新功能。它具有向后兼容性,可提供对 Android 4.4 及更高版本的常规支持,并支持 Android 9 及更高版本上的通行密钥。
这些凭据来自哪里?
凭据来自与凭据管理器集成且用户已启用的凭据提供程序和密码管理工具,如 Google 密码管理工具。此外,对于通行密钥,用户可以选择使用混合流程从其他设备获取这些密钥。
在哪些不同的用例中,凭据管理器更有意义或者更有实现的必要?
凭据管理器为您的应用提供了一种无缝且安全的方式来管理整合 API 中的身份验证流程,该 API 为多种登录方式提供了统一界面。这样做有几个好处:
- 用户可以方便地在同一位置查看所有凭据:通行密钥、密码和联合凭据(例如“使用 Google 账号登录”功能),无需点按 3 个不同的位置
通过整合每个账号的登录方式,提供更省心的登录体验。
此外,在 Android 14 设备上,界面仅会显示最安全、最简单的身份验证方法。例如,如果用户对同一账号同时拥有通行密钥和密码,则在账号选择器中只会建议使用通行密钥。
在一个 API 中支持多账户登录机制。它支持在 Android 应用中使用通行密钥,未来还将能够过渡到无密码登录模式。同时,它也支持密码和联合登录(例如“使用 Google 账号登录”功能),既简化了集成要求,也让持续维护变得更轻松。
在集成过程中需要添加多个依赖项,为什么需要多个依赖项?难道不能只使用一个依赖项来实现这一目标吗?
有 1 个必需的依赖项和 1 个可选的依赖项。应用的依赖项因其用例而异。
- [必需] androidx.credentials:credentials:包含核心凭据管理器功能,包括密码和通行密钥支持。
- [可选] androidx.credentials:credentials-play-services-auth:提供 Google Play 服务的凭据管理器支持,让您可以在旧版设备上使用 API。
凭据管理器是否支持在其他设备中使用凭据?
凭据管理器支持通过混合传输来跨设备使用通行密钥。
开发者是否可以使用凭据管理器将注册和登录流程合并到一个 API 调用中?
目前无此计划。
用户体验
如果用户设置了未向凭据管理器注册的提供程序,系统会向用户显示什么用户体验?
未向凭据管理器注册的提供程序会继续使用自动填充框架,在键盘和下拉菜单中显示建议。
其他
当已有不同的登录选项且也设置了屏锁时,为什么还需要凭据管理器?
在 Android 设备上,用户可以采用不同的解决方案来向应用和网站进行身份验证。由于每个应用都可能与不同的解决方案组合集成,因此用户体验可能截然不同。
无论用户偏爱哪种登录方式或应用支持何种登录方式(用户名和密码登录、通行密钥或联合身份),凭据管理器都会为 Android 上的第三方服务提供一致的登录体验。
通过 Credential Manager API 使用通行密钥可以满足哪些特定的用户要求?
- 用户无需创建或记住复杂的密码。
- 提供能够抵御钓鱼式攻击的登录方式,为用户加强安全保护。
针对重大 bug 发布更新需要多长时间?
Jetpack 每两周发布一次。该平台提供安全版本、季度版本和 dessert 版本,具体取决于 bug 的类型和严重程度。详细了解 Jetpack 发布流程。
集成后是否会对性能(应用启动时间)有所影响?
建议您审慎地选择何时初始化凭据管理器登录流程,并在 API 完成初始化后衡量应用的表现。
此 API 是否与 Android Go 设备兼容?
是,此 API 与 Go 设备兼容。
如果开发者使用短信动态密码或联合身份登录,凭据管理器是否会提供相应的支持?
凭据管理器支持使用通行密钥、密码和 Google ID 令牌作为登录方式。Google ID 令牌还可用于注册工作流。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Credential Manager FAQ\n\nThe question-and-answer pairs on this page are meant to help you gain more\nunderstanding of [Credential Manager](/training/sign-in/passkeys)'s implementation details.\n\nYour feedback is a crucial part of improving the Credential Manager API. Share\nany issues you find or ideas for improving the API using the following link:\n\n\n[Give feedback](https://docs.google.com/forms/d/e/1FAIpQLSdlCw9F01l_7wYO4-Yna5rYO1KKS9huAy5NwPp1PCCnf4tPXg/viewform)\n\n### Integration\n\n**Why is there a need for another Jetpack library for app authentication?**\n\nThe Jetpack Credential Manager library provides a unified sign-in experience\nacross all Android versions. It also lets you get more timely updates with the\nlatest features. It has backward compatibility, with general support on Android\n4.4 and higher, and support for passkeys on Android 9 and higher.\n\n**Where do these credentials come from?**\n\nCredentials come from credential providers and password managers, such as\n[Google Password Manager](https://passwords.google/), that are integrated with Credential Manager and\nthat the user has enabled. Also, for passkeys, users can choose to get them from\nanother device using the hybrid flow.\n\n**What are the different use cases where Credential Manager makes more sense\nor is more necessary to implement?**\n\nCredential Manager offers your app a seamless \\& secure way to manage\nauthentication flows in a consolidated API that offers a unified user interface\nfor several sign-in methods. This has several benefits:\n\n- Users appreciate seeing all their credentials in one place; passkeys, passwords and federated credentials such as Sign in With Google, without needing to tap on 3 different places\n- Offers a simpler login experience by consolidating the sign-in methods for\n each account.\n\n Additionally, on Android 14 devices, the user interface surfaces only the\n safest \\& simplest authentication method. For instance, if a user has both a\n passkey and a password for the same account, only the passkey are suggested\n in the account chooser.\n- Supports multiple sign-in mechanisms within a single API. It brings support\n for passkeys on Android apps, enabling the transition to a passwordless\n future. And at the same time, it also supports passwords and federated sign\n in like Sign in With Google, simplifying integration requirements and\n ongoing maintenance.\n\n**There are multiple dependencies to add during integration, what is\nthe need of multiple dependencies? Isn't it possible to have just one single\ndependency to achieve the same?**\n\nThere is 1 required dependency and 1 optional. The apps include different ones\ndepending on their use cases.\n\n1. \\[**Required** \\] [**androidx.credentials:credentials**](/training/sign-in/passkeys#add-dependencies): Contains the core Credential Manager functionalities including password and passkey support.\n2. \\[**Optional** \\] [**androidx.credentials:credentials-play-services-auth**](/training/sign-in/passkeys#add-dependencies): Provides support from Google Play services for Credential Manager, which lets you use the APIs on older devices.\n\n**Does Credential Manager support using credentials from another device?**\n\nCredential Manager supports cross-device passkey usage through the hybrid\ntransport.\n\n**Can developers merge their sign-up and sign-in flows into one API call using\nCredential Manager?**\n\nNot planned right now.\n\n### UX\n\n**If users have already set up a provider not registered with\nCredential Manager, what UX is shown to the users?**\n\nProviders not registered with Credential Manager continue to operate with the\n[autofill framework](/guide/topics/text/autofill), showing suggestions in the keyboard and drop-down menu.\n\n### Others\n\n**Why is there a need for Credential Manager when there are different sign-in\noptions already in place and screen locks are also there?**\n\nOn Android devices, users have different solutions to facilitate authentication\nto apps and websites. As each app may integrate with different combinations of\nsolutions, the user experience may be drastically different.\n\nCredential Manager provides a coherent and consistent sign in user experience to\n3P services on Android, regardless of the sign-in method that the user prefers\nor that the app supports: username and password, passkey, or federated identity.\n\n**What specific user requirements are catered using passkeys through the\nCredential Manager API?**\n\n- Eliminate the need for users to create and remember difficult passwords.\n- Create a phishing-resistant form of signing in which increases security for users.\n\n**How much time would it take for an update to be released for the major\nbugs?**\n\nJetpack has biweekly releases. The platform has security releases, quarterly\nreleases, and dessert releases depending on the type and severity of a bug.\nLearn more about the [Jetpack release process](/jetpack/androidx/versions).\n\n**Is there any impact on Performance (App Startup time) after integration?**\n\nIt is recommended to wisely choose when to initialize your Credential manager\nsign-in flow and measure your app performance once the API is initialized.\n\n**Is this API compatible with Android Go devices?**\n\nYes, the API is compatible with Go devices.\n\n**If developers use SMS OTP or federated identity for sign in, is that\nalso supported with Credential Manager?**\n\nCredential Manager supports passkeys, passwords and Google ID tokens as sign-in\nmethods. A Google ID token can also be used for sign-up workflows."]]