# How does user login to specific identity?

**URL:** <https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620>\
**Category:** Programs & Applications\
**Created:** [April 28, 2021, 11:55am UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620 "2021-04-28T11:55:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hackape](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/hackape/32/1165_2.png) [@hackape](https://forum.dfinity.org/u/hackape)\
**Post date:** [April 28, 2021, 11:55am UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/1 "2021-04-28T11:55:02Z")

</div>

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](https://sdk.dfinity.org/docs/developers-guide/tutorials/access-control.html).

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.

---

<div class="post-metadata">

**Author:** ![nomeata](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nomeata/32/733_2.png) [@nomeata](https://forum.dfinity.org/u/nomeata)\
**Post date:** [April 30, 2021, 11:00am UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/2 "2021-04-30T11:00:21Z")

</div>

> 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!

---

<div class="post-metadata">

**Author:** ![Pwoseidon](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@Pwoseidon](https://forum.dfinity.org/u/Pwoseidon)\
**Post date:** [May 28, 2021, 4:42pm UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/3 "2021-05-28T16:42:01Z")

</div>

Hi, where can I find info about setting up a ED25519 key pair in my browser? thank u

---

<div class="post-metadata">

**Author:** ![PaulLiu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulliu/32/4701_2.png) [@PaulLiu](https://forum.dfinity.org/u/PaulLiu)\
**Post date:** [May 28, 2021, 5:22pm UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/4 "2021-05-28T17:22:45Z")

</div>

I have an example of generating new identity and cache it in the browser: [reversi/index.js at master · ninegua/reversi · GitHub](https://github.com/ninegua/reversi/blob/master/src/reversi_assets/public/index.js#L12-L30)

Note that this has nothing to do with the Internet Identity service on IC.

---

<div class="post-metadata">

**Author:** ![PaulLiu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulliu/32/4701_2.png) [@PaulLiu](https://forum.dfinity.org/u/PaulLiu)\
**Post date:** [May 28, 2021, 5:58pm UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/6 "2021-05-28T17:58:46Z")

</div>

It is frontend javascript

---

<div class="post-metadata">

**Author:** ![PaulLiu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulliu/32/4701_2.png) [@PaulLiu](https://forum.dfinity.org/u/PaulLiu)\
**Post date:** [May 28, 2021, 6:00pm UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/7 "2021-05-28T18:00:57Z")

</div>

If you have followed the hello world tutorial, you have created a `hello` repository, and there is javascript file in `src/hello_assets/src/index.js`. You can modify it to use your own frontend code.

---

<div class="post-metadata">

**Author:** ![Pwoseidon](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@Pwoseidon](https://forum.dfinity.org/u/Pwoseidon)\
**Post date:** [May 28, 2021, 6:55pm UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/8 "2021-05-28T18:55:11Z")

</div>

> [@PaulLiu](#):
>
> src/hello\_assets/src/index.js

Thank you so much! Appreciate all the help! 😌

---

<div class="post-metadata">

**Author:** ![ohsalmeron](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ohsalmeron/32/30099_2.png) [@ohsalmeron](https://forum.dfinity.org/u/ohsalmeron)\
**Post date:** [February 26, 2024, 2:19am UTC](https://forum.dfinity.org/t/how-does-user-login-to-specific-identity/2620/9 "2024-02-26T02:19:07Z")

</div>

I was trying to check in the code, is this still viable?
