# Help me with Alternative Frontend Origin configuration

**URL:** <https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756>\
**Category:** Developers\
**Created:** [March 1, 2023, 12:01am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756 "2023-03-01T00:01:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 1, 2023, 12:01am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/1 "2023-03-01T00:01:33Z")

</div>

I am trying to configure alternative origin(“[https://icevent.app](https://icevent.app)”) for canister [https://znisf-eqaaa-aaaaj-aabta-cai.raw.ic0.app/](https://znisf-eqaaa-aaaaj-aabta-cai.raw.ic0.app/) by following instruction [https://internetcomputer.org/docs/current/developer-docs/integrations/internet-identity/alternative-origins#configuring-alternative-origins](https://internetcomputer.org/docs/current/developer-docs/integrations/internet-identity/alternative-origins#configuring-alternative-origins) , but it doesn’t show the origin as document when I try to login with domain (“icevent.app”), still get the different principal.

my configurations as below, anyone can help me?

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/3/36bc09d146403b820011ea6b9545780d96ecb860.png)

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/f/fd0adeeaf80039c1dd46c6eb1bb8990827e46172.png)

ii-alternative-origins file:

> {  
> “alternativeOrigins”: [  
> “[https://icevent.app](https://icevent.app)”,“[https://www.icevent.app](https://www.icevent.app)”  
> ]  
> }

---

<div class="post-metadata">

**Author:** ![levi](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/levi/32/22608_2.png) [@levi](https://forum.dfinity.org/u/levi)\
**Post date:** [March 1, 2023, 2:11am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/2 "2023-03-01T02:11:29Z")

</div>

Set the `derivationOrigin` to the original domain.  
[InternetIdentityAuthRequest ii-spec](https://github.com/dfinity/internet-identity/blob/main/docs/ii-spec.md#client-authentication-protocol)  
[AuthClient login agent-js](https://agent-js.icp.xyz/auth-client/classes/AuthClient.html#login)

---

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 1, 2023, 3:58am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/3 "2023-03-01T03:58:40Z")

</div>

doesn’t work

> ```
> authClient.login({
> 
> ```

```
  derivationOrigin: "https://znisf-eqaaa-aaaaj-aabta-cai.raw.ic0.app",
  identityProvider: IDENTITY_PROVIDER,
  maxTimeToLive: ONE_WEEK_NS,
  onSuccess: () => handleAuthenticated(authClient),
});

```

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [March 1, 2023, 5:37am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/4 "2023-03-01T05:37:45Z")

</div>

Are you using dfx and if yes, did you proceed with the all configuration including the chapter " Configuring Your Asset Canister"

> **[Alternative frontend origins | Internet Computer](https://internetcomputer.org/docs/current/developer-docs/integrations/internet-identity/alternative-origins#configuring-your-asset-canister)**
>
> Overview

> Then, configure the .well-known directory to be included, with
> 
> [  
> {  
> “match”: “.well-known”,  
> “ignore”: false  
> },  
> {  
> “match”: “.well-known/ii-alternative-origins”,  
> “headers”: {  
> “Access-Control-Allow-Origin”: “\*”,  
> “Content-Type”: “application/json”  
> },  
> “ignore”: false  
> }  
> ]

---

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 1, 2023, 5:46am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/5 "2023-03-01T05:46:09Z")

</div>

> [@peterparker](#):
>
> all configura

yes

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/4/48c474483009c8511ff1f86d6427f8829a14c085.png)

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [March 1, 2023, 5:52am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/6 "2023-03-01T05:52:45Z")

</div>

Good.

Also [https://znisf-eqaaa-aaaaj-aabta-cai.raw.ic0.app/.well-known/ii-alternative-origins](https://znisf-eqaaa-aaaaj-aabta-cai.raw.ic0.app/.well-known/ii-alternative-origins) seems ok.

Final piece, did you pass the derivation origin to agent-js?

```auto
await authClient.login({
        ...
        derivationOrigin: "https://your-url.ic0.app"

```

where `https://your-url.ic0.app` is the original domain used to sign-in - i.e. the domain you want to use to get the same principal

---

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 1, 2023, 5:55am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/8 "2023-03-01T05:55:25Z")

</div>

yes, like this

> ```auto
> authClient.login({
> 
> ```

```auto
  derivationOrigin: "https://znisf-eqaaa-aaaaj-aabta-cai.raw.ic0.app",
  identityProvider: IDENTITY_PROVIDER,
  maxTimeToLive: ONE_WEEK_NS,
  onSuccess: () => handleAuthenticated(authClient),
});

```

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [March 1, 2023, 6:14am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/9 "2023-03-01T06:14:54Z")

</div>

What version of agent-js are you using?  
Did you re-deploy?

When I go to [https://icevent.app/](https://icevent.app/) and open and debug II, I can notice that no `derivationOrigin` is passed.

So either agent-js is not well configured, or not redeployed or it does not pass the information but that’s where the issue is I think.

 ![Capture d’écran 2023-03-01 à 07.12.16](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/2X/c/c2583fc6b65f31e73a253de456f04be507662b4a.jpeg)

---

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 1, 2023, 6:39am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/10 "2023-03-01T06:39:13Z")

</div>

it works now!

I used version 0.11.3, now changed to 0.13.0 🙂

thanks YOU!

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [March 1, 2023, 6:48am UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/11 "2023-03-01T06:48:04Z")

</div>

> [@bytesun](#):
>
> I used version 0.11.3, now changed to 0.13.0 🙂

Out of curiosity, you mean dfx?

Glad to hear it worked out 👍

---

<div class="post-metadata">

**Author:** ![bytesun](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bytesun/32/2682_2.png) [@bytesun](https://forum.dfinity.org/u/bytesun)\
**Post date:** [March 1, 2023, 3:20pm UTC](https://forum.dfinity.org/t/help-me-with-alternative-frontend-origin-configuration/18756/12 "2023-03-01T15:20:56Z")

</div>

No, my dfx is 0.12.1, but agent.js was old 0.11
