Auth0 Home Blog Docs

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


#1

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

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


#2

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}


#3

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

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

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
});