# Error when using Custom domains, and PKCE Passwordless Login flow in Electron

**URL:** <https://community.auth0.com/t/error-when-using-custom-domains-and-pkce-passwordless-login-flow-in-electron/13027>\
**Category:** Get Help\
**Created:** [July 11, 2018, 6:21am UTC](https://community.auth0.com/t/error-when-using-custom-domains-and-pkce-passwordless-login-flow-in-electron/13027 "2018-07-11T06:21:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adeperio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adeperio/32/8797_2.png) [@adeperio](https://community.auth0.com/u/adeperio)\
**Post date:** [July 11, 2018, 6:21am UTC](https://community.auth0.com/t/error-when-using-custom-domains-and-pkce-passwordless-login-flow-in-electron/13027/1 "2018-07-11T06:21:54Z")

</div>

Hi everyone

I am having some problems wiht custom domains and PKCE auth flow and was wondering if someone could help me out?

I’m using the PKCE login method in my electron app, and am trying to hit the authorize endpoint after having setup up my custom domain.

However I keep getting this error:

 ![image](https://global.discourse-cdn.com/auth0/original/2X/2/2735b41fb2574381693c1f4c8e31defdfff4ce29.jpg)

This is the request I am trying to load in an Electron BrowserWindow:

```
    https://[MY_CUSTOM_DOMAIN]/authorize?
        state=77777777777777777777
        &client=77777777777777777777
        &protocol=oauth2
        &audience=[MY_AUDIENCE]
        &scope=openid%20email%20profile
        &response_type=code
        &code_challenge=777777777777777777777
        &code_challenge_method=S256
        &redirect_uri=[MY_CUSTOM_DOMAIN]/mobile

```

I’ve enabled custom domains in tenant settings, but that doesn’t seemed to have helped either. The custom domains have been verified and are accessible.

This flow has worked without custom domains, its only with a custom domain that I am experiencing this issue

Thanks all

Tony

---

<div class="post-metadata">

**Author:** ![adeperio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adeperio/32/8797_2.png) [@adeperio](https://community.auth0.com/u/adeperio)\
**Post date:** [July 11, 2018, 6:31am UTC](https://community.auth0.com/t/error-when-using-custom-domains-and-pkce-passwordless-login-flow-in-electron/13027/2 "2018-07-11T06:31:22Z")

</div>

Sorry just updating, the authorize Url I am actually building is this:

https://[MY\_CUSTOM\_DOMAIN]/authorize  
audience=${this.config.audience}  
&scope=${this.config.scope}  
&response\_type=code  
&client\_id=${this.config.clientId}  
&code\_challenge=${challengePair.challenge}  
&code\_challenge\_method=S256  
&redirect\_uri=${this.config.redirectUri}

---

<div class="post-metadata">

**Author:** ![adeperio](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adeperio/32/8797_2.png) [@adeperio](https://community.auth0.com/u/adeperio)\
**Post date:** [July 11, 2018, 7:18am UTC](https://community.auth0.com/t/error-when-using-custom-domains-and-pkce-passwordless-login-flow-in-electron/13027/3 "2018-07-11T07:18:13Z")

</div>

Closing as I’ve solved, but leaving solution here for anyone else 🙂

Need to do the additional config for Lock as listed in this article:

> **[Configure Features to Use Custom Domains](https://auth0.com/docs/customize/custom-domains/configure-features-to-use-custom-domains)**
>
> Learn how to configure a custom domain for Auth0 authentication features.

```
var lock = new Auth0Lock(config.clientID, config.auth0Domain, {
  //code omitted for brevity
  configurationBaseUrl: config.clientConfigurationBaseUrl,
  overrides: {
  	__tenant: config.auth0Tenant,
  	__token_issuer: 'YOUR_CUSTOM_DOMAIN'
  },
  //code omitted for brevity
});

```

---

<div class="post-metadata">

**Author:** ![jerdog](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerdog/32/11231_2.png) [@jerdog](https://community.auth0.com/u/jerdog)\
**Post date:** [December 14, 2018, 3:23pm UTC](https://community.auth0.com/t/error-when-using-custom-domains-and-pkce-passwordless-login-flow-in-electron/13027/4 "2018-12-14T15:23:57Z")

</div>


