Electron app doesn't log out on Ubuntu

Hi there, we’re using Auth0 in our Electron app.

On the mac, it logs out as normal. On Ubuntu, when a user logs out, Auth0 doesn’t seem to log out the user. Because next time the user logs in, Auth0 just treats the user as already logged in.

We’re hitting the Auth0 logout endpoint on the logout: https://{{auth0_domain}}/v2/logout

Any ideas?

Hey there!

I want to obtain more information as we’re not sure what path exactly you follow.

  • Have you followed any guidance on how to integrate Auth0 with Electron?
  • How are you implementing the logout functionality?
1 Like

As @konrad.sopala said, we need more information on how you implemented the logout functionality.
Also, let us know which version of Electron are you using.
Be sure to take a look at this tutorial: it was updated last week to follow the best practices and resolving a few issues related to recent versions of Electron.

3 Likes

Hi @konrad.sopala and @andrea.chiarelli, thanks for updating the tutorial. We followed the electron tutorial which is very helpful. We clear out the internal auth data and then call the logoutUrl from BrowserWindow. Here is the code:

  const logoutWindow = new BrowserWindow({ show: false });
  await logoutWindow.loadURL(this.logOutUrl); // which is https://{{auth0_domain}}/v2/logout

  logoutWindow.on('ready-to-show', async () => {
    logoutWindow.close();
  });

Let me know if you need more info.

Is it possible that this behavior is controlled by some setting in Auth0 web UI?

Hey @fsproru, unfortunately, this code doesn’t give us enough information.
Could you provide us with a HAR file with the HTTP requests during the logout phase?
In case you need help in creating your HAR file, here is Chrome’s reference.
Make sure to remove any sensitive information.

As far as I know, Auth0 settings are independent of the client’s operating system.
The fact that the same code works in Mac let me suspect that it is more an Electron or OS issue than an Auth0 issue. But we need more data to understand better.

Thanks @andrea.chiarelli, which data would you like me to provide? Is there a way to get the logs from Auth0?

Hey @fsproru, we need the HTTP requests made by the Electron client during the logout step, as explained in my previous reply.
Also, to get Auth0 logs, you can access your Auth0 Dashboard and select the Logs item on the left menu.

Andrea. To be more precise. When I logout on Ubuntu, when connected to a Google account works fine. But then when I go to login again via the in app login, and then click google as the option, it immediately logs me into the prior Google account, even though I want to select a different account. So something with the Google iframe or whatever it is within Auth0 that seems to be the issue.

Hey @bob33,
Unfortunately, without having a track of the HTTP messages exchanged between the app and the Auth0 server it’s hard to understand what is happening.
Could you provide us with a HAR file with the HTTP requests during the logout step?

1 Like

@andrea.chiarelli, just messaged you the HAR file for the logout phase. I had to log out in a window without { show: false } so I can open the DevTools and export the file. When I opened it, the window said OK and there were no requests in the console. I refreshed it with CMD+R and the logout call showed up in the console and I exported it then.

Let me know if see anything on your end. Would love to get this issue resolved so we can log out on Electron.

Hi @fsproru, thank you for sending me the HAR file.

Looking at it, I cannot see anything wrong. However, the HTTP call to the logout endpoint doesn’t look to come from an Ubuntu machine, where you are claiming your issue occurs:

Anyway, as I mentioned before, the logout endpoint is independent of the client’s operating system, so I think that the issue is on the client side or the different scenario you are testing.

Consider that you may have different behaviors, for example, if you use an Identity Provider like Google or Facebook.
Please, take a look at this document to try to figure out if this scenario applies to your issue: Auth0 Logout.