How does user login to specific identity?

Hi folks! New comer here, just start learning to build dfinity app! I need some help regarding user identity.

For the record, I’m using the dfx (v0.7.0-beta4) cli tool. And I’ve read the access control tutorial.

So, I know I can create identity with dfx identity new bob. This will generate a .pem file in ~/.config/dfx/identity/bob/identity.pem. And I have no problem calling canister with specific identity from command line, it’s in the tutorial.

My question is, how do I do the same from a web frontend interface? I had a hard time finding useful info on this topic.

After some digging I learn that the frontend served from an asset canister, built with default setup, include the @dfinity/agent lib, and it will generate an Anonymous identity (using ED25519 I guess)?

How does the .pem file relate to the ED25519 key pair generated in browser? Can I import this .pem secretKey to be used in browser (convert it into a Ed25519KeyIdentity) , or vice versa?

Somebody unstuck me please! Thanks in advance.

3 Likes

How does the .pem file relate to the ED25519 key pair generated in browser?

I think the correct answer is: Not at all.

The identity management in the browser is undergoing some important and presumably innovative changes, but I am not sure how much I should spoil. Expect some interesting demos at next week’s event!

5 Likes