-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Can't get NativeAuthenticator to work #295
Comments
Hi @kpeeters, NativeAuth has an option to import the database from the FirstUse database. However, by default when installing NativeAuth eberybody should #, even admin. The admin listed on the config file will automatically have access to the system. Could this be the problem? |
I understand that; the problem is that the login screen is exactly the same as with FirstUse, there is no option to #. It's probably reading the settings about which authenticator to use from two different places, with the part of the code that produce the login form seeing one setting, and the part that does the actual validation seeing the other. But I can't find it. |
This is something I am fixing for the next version (login will have a link for #). To check if you are using Native Auth you can go to |
Ah, you may want to write that somewhere in the docs ;-) It worked now, in the sense of producing a # form, but I can't login as my admin account anymore, and journalctl says |
I also experienced this issue. |
Is there any update on this? Had the exact same problem when trying to switch to NativeAuthenticator and couldn't find a method to get around it. The authenticator works great but I have no more admin user I'm able to login with to approve the users after activating it. Also as mentioned before setting Is there maybe a method to create a new admin user using the console for NativeAuthenticator? Had no luck with the regular Edit: Actually it seems like I can just register the admin account through the # page and have access again. The documentation for NativeAuthenticator actually states "It is important to notice that admin must also create a new user through #.", so if this is expected behavior it is a little confusing to say the least 😛 |
I am having the same problem described by @kpeeters back in March 2019 - After enabling Native Authentication the Login and # pages are exactly the same. We conducting a workshop with about 40 students next week Tuesday, 25th and it would be appreciated if my problem can get resolved prior to then. |
Sorry for my absence. Will take a look later today |
How are the Admins being created on FirstUse? I tested with the admin being configured on |
@RobinTTY admins must create their accounts if you didn't import it from the FirstUseAuthenticator as you can see here: https://github.com/jupyterhub/nativeauthenticator/blob/2fede2bfc109c9107064eb4a7c48dd4e4d6a79ee/nativeauthenticator/nativeauthenticator.py#L236. The admin definitions are being absorbed from the Also, I would recommend get the last version from the Github not pypi because I didn't updated it yet |
@leportella Ah ok, thank you. |
I just uploaded the last master version to pip: https://pypi.org/project/jupyterhub-nativeauthenticator/0.0.5/ CHANGELOG: https://github.com/jupyterhub/nativeauthenticator/blob/master/CHANGELOG.md |
@leportella one thing which coould improve tljh is to show requests for authorization in the admin page. if not possible, at least a button "REQUESTS" which takes the admin to |
Reading through all the comments I'm still not sure what to do. I have a working tljh setup with a admin user that I can use to log in.
then reload the config (Following the doc https://tljh.jupyter.org/en/latest/howto/auth/nativeauth.html and using I can't log-in with my admin user anymore and get I also tried to to # again using the old admin user and password. After # I get Now if I try to log-in again still gives me Looks like I'm missing a crucial step. It would be really great if someone who got this working could give me a hint. |
log file from
extract from
|
Adding the file cat /opt/tljh/config/jupyterhub_config.d/native_auth.py
c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'
c.Authenticator.admin_users = {'admin'} To understand why this works I found the following link very helpful: Thanks for providing tljh! |
Closing as resolved via #295 (comment), thanks for helping each other out! Also note that it could be relevant to track #264 |
I was considering opening a new issue, but after searching around a bit, I see that the problem is known and being worked on in #264, and the documentation improvement I was going to suggest already suggested in #564. However, since I just spent quite some time on this problem, I am going to document what I figured out here. In addition to the solution by @ibayer , there is another one using tljh-config:
The problems I had (and I assume others too) is that based on the current tljh documentation and the NativeAuthenticator documentation, we should just do the following:
However this leads to the following configuration:
And the expected admin username is then "{admin}" instead of "admin". Signing up as "{admin}" seems to work, but then leads to this error when signing in:
I suppose there might be an even better way by setting it so that it is a list, like for users.admin, but I have not figured out how to do it and have found no documentation indicating how to do it either. "tljh-config add-item" also did not work. |
From a default install which worked fine, I did
That didn't work (could not log in as admin anymore, and there was no difference in the login screen). The log obtained with
journalctl -u jupyterhub
does not show anything when attempting to log in.Lacking logs, I also tried
as instructed at https://native-authenticator.readthedocs.io/en/latest/quickstart.html (in the hope that my install did not work because I simply did not have nativeauthenticator yet). That did not work either, unfortunately.
Any pointers? What is the correct procedure, and how can I get some more logging info out of tljh so I can debug things like this in the future myself? Thanks!
The text was updated successfully, but these errors were encountered: