Concordium / concordium-reference-wallet-ios

Reference wallet for the Concordium blockchain
Apache License 2.0
11 stars 10 forks source link

Notabene Error Not Handled #100

Closed td202 closed 2 years ago

td202 commented 2 years ago

Bug Description

An error reported from notabene when submitting an identity object request is not handled. When the error occurs, instead of the usual flow, the request to notabene redirects to the callback URL with an error, such as:

concordiumwallettest://identity-issuer/callback/0F463571-D594-43AE-8F8D-789F84BBB5E7#error=%7B%22error%22%3A%7B%22code%22%3A%22INVALID_REQUEST%22%2C%22detail%22%3A%22Invalid%20Identity%20Object%20Request%22%7D%7D

In this case, the response should be interpreted as an error, and a message shown to the user. Instead, it is treated as if it were a successful identity issuance and a pending identity/account is created that cannot ever resolve.

(This seems at least in part to be caused by a problem with parseCallbackUri. In the case where it does not contain the string "#code_uri=", the entire URI is returned.)

Steps to Reproduce

Attempt to create an identity while notabene is failing.

Expected Result

The identity creation should fail with an appropriate error reported to the user

Actual Result

Identity creation appears to succeed without going through the full process, and a pending identity and account are created in the wallet that cannot be resolved.

Versions

concordium-cl commented 2 years ago

To be discussed: Should the user get the possibility to contact the IDP immediately, so the incident does not necessarily have to go a detour via us?

concordium-cl commented 2 years ago

Error message also to be improved in Android: https://github.com/Concordium/concordium-reference-wallet-android/issues/61

concordium-cl commented 2 years ago

No immediate test possible.