Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.4.0rc1] Local autologin not working #3357

foosel opened this issue Nov 28, 2019 · 5 comments


Copy link

@foosel foosel commented Nov 28, 2019


As reported by @schnello in #3347 (comment):

Looks like the autologin function is not always working.
accessControl: autologinAs: admin autologinLocal: true localNetworks: - -


Pre 1.4 i need never any login informations with the settings above. Now with 1.4 i have to enter the login information once per day.


Needs further analysis first.


This comment has been minimized.

Copy link

@loskexos loskexos commented Nov 28, 2019

Not sure if I observe the same item with this:

  • logon (as user octoadm)
  • Then close browser (alt-F4)
  • Then open browser again and open the octoprint webpage

result: I have to logon by manually entering user and password.

I thought it's a security feature :). But looks similar to what is described here.

The log states it actually is logging on a user passively. Username "None".

<<action: open webpage>>

2019-11-28 21:35:20,132 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:
2019-11-28 21:35:20,393 - octoprint.server.util.flask - INFO - Passively logging in user None from ::ffff:

<<action: enter username octoadmin/password>>

2019-11-28 21:35:29,765 - octoprint.server.api - INFO - Actively logging in user octoadm from ::ffff:
2019-11-28 21:35:31,567 - octoprint.server.util.sockjs - INFO - User octoadm logged in on the socket from client ::ffff:

code for the message at "21:35:20,393" seems to be in ./oprint/lib/python2.7/site-packages/octoprint/server/util/, lines 593-595. (only matching location for that message above I found).

        if user is not None and user.is_active:
                # login known user
      "Passively logging in user {} from {}".format(user.get_id(), remote_address))
                user = login(user)

Interestingly code checks IF user is NOT "None" and then logs the user as "None" in octoprint.log. Are "if user" and "user.get_id()" intentionally two different things?
(I don;t know python, thats how understand that line. Maybe it should read ..if user.get_id() is not None... ?).

It's not even reaching the autologin parts for me in the following lines that @schnello reported, so maybe a different case.

Just an observation reading this thread. Not a problem for me.
Observed with chrome and firefox.

Edit: tested - testing against user.get_id does not show "passively logging in None" in log.
Logon still needed (and might be intentional).

@foosel foosel changed the title [1.4.0] Local autologin not working [1.4.0rc1] Local autologin not working Nov 29, 2019

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Nov 29, 2019

@loskexos that's a good hint actually... there might be a logic issue here in that code block due to anonymous users no longer being None but having no id. Hence the passive login will trigger even for them and the autologin won't even initiate.

I'll have to take a close look at things here, I'm fairly certain there was a reason why I don't check if the user is anonymous here, but I'm not 100% sure.

foosel added a commit that referenced this issue Nov 29, 2019
Closes #3357

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Nov 29, 2019

Should be fixed by the above commit.


This comment has been minimized.

Copy link

@schnello schnello commented Nov 29, 2019

tested and i can confirm. Autologin is now working again.


This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Dec 2, 2019

1.4.0rc2 is out.

@foosel foosel closed this Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.