0xyu5
June 8, 2022, 6:11pm
1
Is there a way to extract the private key of the Dapp that logs in with Internet Identity?
I want to create a Dditrikt or other posting bot using ic-py.
I think this thread is may help, but I can’t understand it well.
Could you please tell me the conclusion?
opened 11:42PM - 07 Apr 22 UTC
closed 02:28PM - 31 May 22 UTC
Hello, not sure if this is possible, but figured I would ask anyway.
I can fi… nd my Internet Identity keys in local storage. If I take the first 32 bytes, then I get a nice ed25519 key that I can import with Identity("ed25519_key_I_took_from_local_storage"). This works and the identity is imported. When I create the agent with the client, I can call agent.get_principal(), but I can't get the agent.get_principal() to match up with the principal that I actually have in an app when I login with Internet Identity. Even if I change the client (to perhaps the domain of the website I was logging in to), the principal I get from agent.get_principal() stays the same.
Am I missing something here? Or am I trying to do something that isn't actually possible? Would love to know how to authenticate with an existing Internet Identity, and perhaps my strategy is flawed somehow.
Thank you!
Thank you.