Skip to content

Conversation

@Nailik
Copy link
Contributor

@Nailik Nailik commented Oct 17, 2024

🎟️ Tracking

#4100

📔 Objective

Currently there is only an implementation to provide or save Fido2 credentials via the CredentialManager.
The objective is to add the possibility to save and create Passwords.

Credential Manager usage: https://developer.android.com/identity/sign-in/credential-manager
Credential Provider to provide Credential Manager: https://developer.android.com/identity/sign-in/credential-provider
Example Project: https://github.com/android/identity-samples/tree/main/CredentialManager

Status

  • new BitwardenCredentialProviderService to handle incoming credential requests
  • new CredentialCompletionManager (from Fido2CompletionManager) to handle both passkeys and passwords
  • Overwrite Password/Username combination confirmation dialogs.

Working on:

  • Cleanup (formatting, comments etc)
  • fixing tests / adding tests

Found issues:

  • showFido2ErrorDialog doesn't always show the correct reason, however to stay consistent the showPaswordErrorDialog also shows always the same issue

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@CLAassistant
Copy link

CLAassistant commented Oct 17, 2024

CLA assistant check
All committers have signed the CLA.

@bitwarden-bot
Copy link

Thank you for your contribution! We've added this to our internal Community PR board for review.
ID: PM-13789

@bitwarden-bot bitwarden-bot changed the title [DRAFT] add credential manager provider for passwords [PM-13789] [DRAFT] add credential manager provider for passwords Oct 17, 2024
@Nailik Nailik force-pushed the feature/add-password-credential-manager-provider branch 3 times, most recently from 4aa9f5a to 5a6e528 Compare October 20, 2024 01:03
@Nailik
Copy link
Contributor Author

Nailik commented Oct 21, 2024

I would like a check/pre-review from the code owners before starting to work on the tests.

Maybe this could be split into multiple smaller PRs as it got already a lot bigger than i thought it would be - and it's also a lot to review

@Nailik Nailik changed the title [PM-13789] [DRAFT] add credential manager provider for passwords [PM-13789] add credential manager provider for passwords Oct 22, 2024
@djsmith85 djsmith85 linked an issue Nov 11, 2024 that may be closed by this pull request
2 tasks
@Nailik
Copy link
Contributor Author

Nailik commented Jan 17, 2025

due to a lot of changes in the types it's currently not compiling

however i am not sure if i just waste my time here since i get no response or any info if this feature is planned ...

@SaintPatrck
Copy link
Contributor

Hi @Nailik

Apologies for the late response. We've been busy shoring up our native releases. We are interested in consuming these changes and do appreciate you taking the time to submit them.

As you stated, there has been refactoring that conflicts with the changes you submitted. There's potential for more refactoring once Google releases the next version of Credential Manager (1.5.0). I suggest holding this PR until the new CredMan library is available. As soon as time permits we will review and provide feedback.

@Nailik
Copy link
Contributor Author

Nailik commented Jan 21, 2025

@SaintPatrck perfect thank you.

@Nailik
Copy link
Contributor Author

Nailik commented Mar 25, 2025

androidx.credentials:credentials:1.5.0 was released on 15. Mar so i will resume working on this PR now.
Will take some time

@SaintPatrck
Copy link
Contributor

androidx.credentials:1.5.0 introduces breaking changes. I suggest holding off until we have properly refactored to accommodate the changes (see WIP #4919).

@Nailik
Copy link
Contributor Author

Nailik commented Mar 26, 2025

thx for letting me know

@Nailik
Copy link
Contributor Author

Nailik commented May 12, 2025

I am currently rewriting the whole PR.

Currently i am blocked because of an issue with #5101.

@SaintPatrck
Copy link
Contributor

Hi @Nailik

I'm glad to see you're still willing to pick this back up! It's very much appreciated. 🫶

You may want to build on #5177 since it includes changes that will make implementing password credentials a little cleaner.

SaintPatrck and others added 12 commits July 15, 2025 10:07
…ider

# Conflicts:
#	app/src/main/kotlin/com/x8bit/bitwarden/data/credentials/manager/BitwardenCredentialManagerImpl.kt
#	app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt
#	app/src/test/kotlin/com/x8bit/bitwarden/data/credentials/manager/BitwardenCredentialManagerTest.kt
#	app/src/test/kotlin/com/x8bit/bitwarden/data/vault/datasource/sdk/model/CipherViewUtil.kt
#	app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModelTest.kt
@Nailik
Copy link
Contributor Author

Nailik commented Jul 23, 2025

hi i just fixed the conflicts, would be nice if we can get this merged, it's really getting harder to fix the conflicts with main when there are refactorings that don't take into account that not every credential operation is about passkeys

…in order to make more clear it's only used for fido2/passkeys
): List<CredentialEntry> {
if (this.isEmpty()) return emptyList()

val ciphers = autofillCipherProvider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't utilize autofillCipherProvider in its current state because it omits ciphers that we want included in the CredentialManager results. In this case, ciphers that require reprompt are being omitted. During the CredentialManager flow we can prompt for master password, so we should be including them in the results.

@SaintPatrck
Copy link
Contributor

@Nailik Thanks for staying on top of the updates. In order to relieve some of your burden, I can update the failing tests and make a few other tweaks to accommodate the recent changes I introduced. My hope is to get this PR merged by end of week. 🤞

@SaintPatrck SaintPatrck force-pushed the feature/add-password-credential-manager-provider branch from 1de00fc to 2c3c763 Compare July 23, 2025 19:42
…nager

This commit refactors `BitwardenCredentialManagerImpl` and its tests to utilize `CipherListView` objects directly for credential retrieval and matching, instead of relying on `AutofillCipherProvider`.

Key changes:
- `BitwardenCredentialManagerImpl` now uses `CipherMatchingManager` to filter `CipherListViews` based on the calling app's package name.
- The `getCredentialEntries` method in `BitwardenCredentialManagerImpl` has been updated to fetch and filter `CipherListViews` from `VaultRepository`.
- `CredentialEntryBuilder` and its implementation now accept `List<CipherListView>` instead of `List<AutofillCipher.Login>` for building password credential entries.
- The `AutofillCipherProvider` dependency has been removed from `BitwardenCredentialManagerImpl` and `CredentialProviderModule`.
- Introduced `isActiveWithCopyablePassword` extension for `CipherListView`.
- Tests for `BitwardenCredentialManagerImpl`, `CredentialEntryBuilderTest`, and related ViewModels have been updated to reflect these changes, including mocking `CipherMatchingManager` and providing `CipherListView` instances.
- Updated `createMockProviderGetPasswordCredentialRequest` to accept a number parameter for easier test data generation.
- Minor adjustments in test helpers and mock object creation to align with the refactoring.
- `VaultItemListingViewModel` now checks `CipherListView.reprompt` before fetching the full `CipherView` for password credential requests. An error is now sent if the `CipherListView` is not found.
@SaintPatrck SaintPatrck force-pushed the feature/add-password-credential-manager-provider branch from 2c3c763 to 48c49a0 Compare July 23, 2025 19:48
@SaintPatrck
Copy link
Contributor

@Nailik we're ready to merge the changes, but the CLA is giving us pause. Is kilian.eller a handle of yours? If so, are you able to associate the corresponding email address with your GitHub account to satisfy the CLA agent?

@SaintPatrck SaintPatrck added this pull request to the merge queue Jul 24, 2025
Merged via the queue into bitwarden:main with commit 355facc Jul 24, 2025
11 of 12 checks passed
@Nailik Nailik deleted the feature/add-password-credential-manager-provider branch July 24, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No Credential Manager Password Prompt

5 participants