2

I have a UWP application that will get the username and password from the user and store it in the password vault. I am able to get the password from vault within the application. But, when I was trying to fetch the password through background task of the same application i got the exception says :

Element Not Found cannot get credentials from vault.

I know password vault is unique to app or service, But why it was unable to fetch the password through background task?

Muhammad Touseef
  • 4,357
  • 4
  • 31
  • 75
Vishnu s
  • 261
  • 2
  • 18
  • is the background task out-of-process or [in-process](https://learn.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-an-inproc-background-task)? – kennyzx Sep 10 '18 at 09:49
  • It is a out of process background task. – Vishnu s Sep 10 '18 at 09:54
  • Just google around, this is a [supported scenario](https://blogs.windows.com/buildingapps/2016/07/25/offline-apps-what-to-do-when-your-user-disconnects/): _This is particularly helpful when using a background task to securely retrieve and store data for offline use since apps and services don’t have access to credentials associated with other apps or services._ Please provide the code you use in the BT to retrieve password from the vault. – kennyzx Sep 10 '18 at 10:11
  • I referenced the documentation in this URL "https://learn.microsoft.com/en-us/windows/uwp/security/credential-locker – Vishnu s Sep 10 '18 at 10:57
  • I could not reproduce your issue, I have created sample that contain out process `BackgroudTask`, then fetch the password successfully, Please check if you have saved `PasswordCredential` successfully. – Nico Zhu Sep 11 '18 at 08:59
  • Yes password successfully saved in the vault. I can see the stored password in the credential manager. – Vishnu s Sep 11 '18 at 11:57
  • 1
    Please share a [mcve]. – Nico Zhu Sep 12 '18 at 01:29
  • In store dump I got the exception like stowed_exception_80070490_vaultci.dll!vaultwinrtorginateerror – Vishnu s Sep 19 '18 at 12:37

0 Answers0