How to export the identity of web II to execute in cli mode?

Hello comrades!

I tested in development mode and found that:

  1. The Seed Phrase exported in web II and then restored in nodejs through Secp256k1KeyIdentity.fromSeedPhrase(...) are not consistent. When calling actor.whoami(), the return value in web and nodejs is different?
  2. Or can the identity of web’s const identity = authClient.getIdentity(); be exported?

We don’t have a tutorial or examples on how to do that.

dfx doesn’t support that yet. Nor we have done it with nodejs.

@dskloet did himself a man in the middle attack and connected his local environment to his mainnet principal. He did a PR for it: Vite with SSL and not committed SNS by dskloetd · Pull Request #2981 · dfinity/nns-dapp · GitHub .

Maybe this helps your use case?

I believe other developers would be interested in this, so if you manage to do it and publish the results here, I would love to link them in our docs or FAQ page.

Thanks!

PS: remember that II gives a different identity to each dapp using the frontend domain as explained here.