Auth0 Home Blog Docs

Auth0 Electron Callback URL mismatch

auth0
electron
callback-urls
url
callback

#1

I can’t seem to get file:/// to work with our Electron app. I was able to get things working by adding the full callback file:/// url into the Allowed Callback URLs setting. The callbacks work just fine on the web using the callback with https://*.netlify.com/login. Does it now have to be something like file://* or file:///*?

Client ID: QR579kSOEqhOqPAfqjfTPHaz5hJPvEKT

Auth0 lock version: 11.0.1

Callback mismatch

?Callback mismatch

Auth0 lock setup

?Auth0 lock setup


#2

What I would do in this case is,

a) Register a callback URL like https://{your-auth0-domain-name}.auth0.com/mobile, file:///
b) Set the callback URL in your code to location.href
c) Use the auth0 lock as follows,

      var lock = new Auth0Lock(AUTH0_CLIENT_ID, AUTH0_DOMAIN, {
    auth: {
      redirect: false,
      sso: false
    }
  });

You can find a full working example here,

Sahil


#3

Using your samples i receive a 403 and “Origin file:// is not allowed.” error from /co/authenticate. How i can fix this ?