How to get back a code_uri?

I’m implementing a new wallet for concordium, after I redirect the users to the KYC process, and I get the code_uri what happens if the user interrupts the account transaction deployment? How can I get the code_uri back to complete the account deployment process

I am not sure exactly what you are asking.

Do you mean in the identity issuance process? What do you mean by account deployment process?

In the identity issuance process you would eventually get redirected to some URL which contains code_uri. That would contain the location where you are meant to poll for the identity object.

After creating an identity on the provider’s website i get back to my website with a code_uri in the url parameters. If something goes wrong how can I get back the code_uri to complete the process

You cannot get it back. If the process is interrupted somewhere before you complete it and get the code_uri you have to restart it.

Ok but if i have finished the KYC process and i try to start another one with the same mnemonic I get an error from the provider. Maybe i could try using a different identityIndex?
But then how can i get the first “free” identity index?

If I lose the code_uri is there another way to get my identityObject?

Yes, if you have completed it you can then do identity recovery to recover it.

Can you please describe me more in depth how should I implement in my js code the recover mechanism? I’m using concordium websdk

There is a function

export function createIdentityRecoveryRequest(
    input: IdentityRecoveryRequestInput
): Versioned<IdRecoveryRequest>

which you use to generate the request for recovering the identity. This in particular takes a seed phrase as an argument.

This is how it is then used (this code examples if from the browser wallet)

function getRecoverUrl(inputs: RecoveryInputs, provider: IdentityProvider) {
    const timestamp = Math.floor( / 1000);
    const idRecoveryRequest = createIdentityRecoveryRequest({ ...inputs, timestamp, ipInfo: provider.ipInfo });

    const searchParams = new URLSearchParams({
        state: JSON.stringify({ idRecoveryRequest }),
    return `${provider.metadata.recoveryStart}?${searchParams.toString()}`;

This construct the recovery URL, query it then and if there is an identity with those credentials the IDP will return the identity object.

The recoveryStart URL you can get from the list of recovery URLs provided by the IDPs, here is a list on mainnet

1 Like