bcgov / bc-wallet-mobile

BC Wallet to hold Verifiable Credentials
Apache License 2.0
60 stars 45 forks source link

Credo does not respond with the newest non-revoked credentnial #1880

Open cvarjao opened 5 months ago

cvarjao commented 5 months ago

We previously added logic to the proof acceptance mechanics to address #308 where Credo (formerly AFJ) was not automatically selecting the newest non-revoked credential. This logic may non longer be required as of Credo 0.4.x or 0.5.0. When we upgrade to 0.5.0 we should experiment and determine if this logic is still warranted.

  1. Issue multiple credentials in various order and states of revocation;
  2. Allow Credo to automatically select credentials and confirm if its choosing the newest non-revoked credential when the proof request does not specify either newest or not-revoked.

If the behaviour remains the same, refactor the proof screen so the logic and code documentation better reflects its purpose. Extract logic to a helper file called credhelper, helpers, or credentias.ts for clarity. Make sure code is shared with PersonCredential.tsx so they follow the same logic.

jleach commented 2 months ago

Still an issue. Tested with 1.0.17 Build 1740 w/ Lawyer showcase. It did not select the un-revoked lawyer credential but rather a revoked one and I was able to select the correct one manually to complete the proof. I think this should be automatic. See screen shots below.

Image Image Image

jleach commented 2 months ago

When handling credential revocation status, it often relates to a specific date mentioned in a proof request. If the proof request doesn't include this revocation information, Credo can't determine whether a credential is revoked or not during its automatic selection process. As a result, it might pick a revoked credential that technically satisfies the request but isn’t the best choice from the user's perspective.

This automatic selection works well in scenarios without a user interface (headless mode), but it can be confusing in a UI, as showing a revoked credential can be misleading. This issue highlights why we needed to create our own custom credential selection logic, as discussed in Issue #308.

@cvarjao