# Email Password Authentication

**URL:** <https://forum.dfinity.org/t/email-password-authentication/43474>\
**Category:** Developers\
**Tags:** Functional-Programming, Discussing, nns\
**Created:** [April 6, 2025, 11:34am UTC](https://forum.dfinity.org/t/email-password-authentication/43474 "2025-04-06T11:34:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ichetanmittal](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ichetanmittal/32/24098_2.png) [@ichetanmittal](https://forum.dfinity.org/u/ichetanmittal)\
**Post date:** [April 6, 2025, 11:34am UTC](https://forum.dfinity.org/t/email-password-authentication/43474/1 "2025-04-06T11:34:24Z")

</div>

I want to make a similar authentication system like Yuku , where user can login or signup using Email id , how can that be done ?

Can someone share the reference docs for it ? Do we need to create a Delgeation Service canister for it separately or are there any packages already present to use this service

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/e/3/e366befa67d8420fa05de035ab368277ff6dfc88.jpeg)

---

<div class="post-metadata">

**Author:** ![baolongt](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@baolongt](https://forum.dfinity.org/u/baolongt)\
**Post date:** [April 6, 2025, 1:53pm UTC](https://forum.dfinity.org/t/email-password-authentication/43474/2 "2025-04-06T13:53:35Z")

</div>

you can look at [NFID identity manager](https://github.com/internet-identity-labs/nfid-wallet-server/tree/main/src/identity_manager). The wallet can login with email, passkey and seedphrase for one wallet

> **[nfid-wallet-server/src/icrc1\_registry at main ·...](https://github.com/internet-identity-labs/nfid-wallet-server/tree/main/src/icrc1_registry)**
>
> Canister backend for the fattest wallet in Web3. Contribute to internet-identity-labs/nfid-wallet-server development by creating an account on GitHub.

Another [example](https://github.com/slide-computer/signer-js/blob/main/packages/signer-transport-auth-client/src/authClientChannel.ts#L134) in frontend.

For short, they use DelegationChain

---

<div class="post-metadata">

**Author:** ![ichetanmittal](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ichetanmittal/32/24098_2.png) [@ichetanmittal](https://forum.dfinity.org/u/ichetanmittal)\
**Post date:** [April 6, 2025, 2:09pm UTC](https://forum.dfinity.org/t/email-password-authentication/43474/3 "2025-04-06T14:09:07Z")

</div>

basically you are telling to integrate NFID right for email authentication ? but i wanted this Yuku method where after filling in email password , a verification code goes into email with which you are trying to register and then only the authentication gets completed

---

<div class="post-metadata">

**Author:** ![baolongt](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@baolongt](https://forum.dfinity.org/u/baolongt)\
**Post date:** [April 7, 2025, 3:52pm UTC](https://forum.dfinity.org/t/email-password-authentication/43474/4 "2025-04-07T15:52:08Z")

</div>

I dont mean to say that. I mean you have to build your own identity service and use delegation chain.

---

<div class="post-metadata">

**Author:** ![adpopescu338](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/adpopescu338/32/25299_2.png) [@adpopescu338](https://forum.dfinity.org/u/adpopescu338)\
**Post date:** [April 11, 2025, 10:25pm UTC](https://forum.dfinity.org/t/email-password-authentication/43474/5 "2025-04-11T22:25:00Z")

</div>

If your system is fully on chain, having a canister that issues delegations is a pretty simple solution.

The development speed is amazing with [Azle](https://demergent-labs.github.io/azle/) and it does support the `@dfinity/identity` library which is all you need to issue delegations:

```typescript
import { Ed25519KeyIdentity, DelegationChain } from '@dfinity/identity';
import { PublicKey } from '@dfinity/agent';

const userSeedPhrase = getUserSeedPhrase();
const seedBytes = hexToBytes(userSeedPhrase);
const seedIdentity = Ed25519KeyIdentity.generate(seedBytes);

const clientPublicKey: PublicKey = {
  toDer: () => input.clientPublicKeyDer,
};

const delegationChain = await DelegationChain.create(
  seedIdentity,
  clientPublicKey,
  expiration: new Date(Date.now() + 24 * 60 * 60 * 1000),
);

return delegationChain.toJSON();

```

In case it’s useful, here’s a [Miro diagram](https://miro.com/app/board/uXjVLX9nuc8=/) for a Hybrid dApp where I developed an email authentication with magic links. The main challenge was making sure nobody but the user could access their delegation.

---

<div class="post-metadata">

**Author:** ![sea-snake](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/sea-snake/32/7243_2.png) [@sea-snake](https://forum.dfinity.org/u/sea-snake)\
**Post date:** [April 12, 2025, 12:42pm UTC](https://forum.dfinity.org/t/email-password-authentication/43474/6 "2025-04-12T12:42:45Z")

</div>

Keep in mind that secrets like seeds are not secure within a canister. If you need to sign something, consider using either Threshold ECDSA or canister signatures (as see in II).
