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

FirstUseAuthenticator not prompting to create password for new user #306

Closed
Dr-Juice opened this issue Apr 17, 2019 · 10 comments · Fixed by #476
Closed

FirstUseAuthenticator not prompting to create password for new user #306

Dr-Juice opened this issue Apr 17, 2019 · 10 comments · Fixed by #476
Labels
support Support questions (should be on discourse.jupyter.org instead)

Comments

@Dr-Juice
Copy link

No description provided.

@yuvipanda
Copy link
Collaborator

Heya! Can you provide some more details about what behaviour you were expecting and what behavior you got? That'll help us figure out what's happening.

Thanks!

@Dr-Juice
Copy link
Author

Hi
Sorry about that, I guess I closed it before entering the explanation.

I've installed the latest version of TLJH and configured for First Use Authenticator. According to the documentation, when creating a new user, that user should be prompted to create or change a password upon first logon? Is that the correct expecatation? What happens is, when I create the user account, I can log in without any password. If I navigate to /hub/auth/change-password I can then change the password and it's set. But the user account seems to be created with no password needed initially.

@yuvipanda yuvipanda added bug Something isn't working support Support questions (should be on discourse.jupyter.org instead) and removed bug Something isn't working labels May 20, 2019
@efedorov-dart
Copy link

Yep. Confirm this bug. New user is not requested to change password on first login.

@GeeCastro
Copy link

Same issue except when I go to /hub/auth/change-password and try to set a new password I get a

500 : Internal Server Error

@efedorov-dart
Copy link

Same issue except when I go to /hub/auth/change-password and try to set a new password I get a

500 : Internal Server Error

I've sent fix to this issue as pull request. It not yet accepted.

@gareth-j
Copy link

gareth-j commented Aug 8, 2019

I'm having the same problem. I've got a fresh install of TLJH on an Ubuntu 18.04 VM. When I create a new user I don't get a prompt to set a password for the user on first login. If I try and go to /hub/auth/change-password I get a set password page but on setting the password the server returns a 500 error. Fromjournalctl -u jupyterhub I can see this error

[I 2019-08-08 10:54:25.716 JupyterHub proxy:319] Checking routes
[I 2019-08-08 10:54:25.998 JupyterHub log:174] 200 GET /hub/api/users (cull-idle@127.0.0.1) 14.84m
[I 2019-08-08 10:54:46.611 JupyterHub log:174] 200 GET /hub/auth/change-password (test@{host-ip}
[E 2019-08-08 10:54:52.395 JupyterHub web:1788] Uncaught exception POST /hub/auth/change-password
    HTTPServerRequest(protocol='http', host='{host-ip}', method='POST', uri='/hub/auth/change-p
    Traceback (most recent call last):
      File "/opt/tljh/hub/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
        result = await result
      File "/opt/tljh/hub/lib/python3.6/site-packages/firstuseauthenticator/firstuseauthenticator.
        self.authenticator.reset_password(user.name, new_password)
    AttributeError: 'coroutine' object has no attribute 'name'

@silhouetted
Copy link

Hi @yuvipanda,

Was there any resolution to this bug?

I am having the exact same issue as above. I've installed the latest version of TLJH on an AWS Ubuntu 18.04 instance, and configured for First Use Authenticator. It looks great - like exactly what I need to manage a couple of MA students.

However, like garethj, I can log in with the admin account and it asked me to create a password. But when I log in to test their credentials, I put in a username and it does not ask for a password. I cannot see any option to change a password, and if I navigate to /hub/auth/change-password, the page asks for a new password but then returns a 500 error.

I can run journalctl -u jupyter-thomas | grep error, which returns nothing. There is also nothing if I grep 500.

It is a shame because TLJH looks awesome but if the users cannot set a password I am not sure how realistic using it is.

@silhouetted
Copy link

(thomas is the name of the user for whom the error occured)

@samrickman
Copy link

samrickman commented Nov 5, 2019

I realise now I was asking journalctl for the logs for the wrong user. For -u jupyterhub I can see the error.

Seems to be the same error as @gareth-j , AttributeError: 'coroutine' object has no attribute 'name'.

Full details are:

Nov 05 11:17:22 ip-172-31-24-170 python3[910]: [I 2019-11-05 11:17:22.000 JupyterHub log:174] 200 GET /hub/auth/change-password (thomas@77.98.80.79) 33.93ms
Nov 05 11:17:35 ip-172-31-24-170 python3[910]: [I 2019-11-05 11:17:35.125 JupyterHub log:174] 200 GET /hub/api/users (cull-idle@127.0.0.1) 17.63ms
Nov 05 11:17:36 ip-172-31-24-170 python3[910]: [E 2019-11-05 11:17:36.240 JupyterHub web:1788] Uncaught exception POST /hub/auth/change-password (77.98.80.79)
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:     HTTPServerRequest(protocol='http', host='ec2-3-9-174-73.eu-west-2.compute.amazonaws.com', method='POST', uri='/hub/auth/change-password', version='HTTP/1.1', remote_ip='77.98.80.79')
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:     Traceback (most recent call last):
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       File "/opt/tljh/hub/lib/python3.6/site-packages/tornado/web.py", line 1699, in _execute
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:         result = await result
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       File "/opt/tljh/hub/lib/python3.6/site-packages/firstuseauthenticator/firstuseauthenticator.py", line 53, in post
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:         self.authenticator.reset_password(user.name, new_password)
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:     AttributeError: 'coroutine' object has no attribute 'name'
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:
Nov 05 11:17:36 ip-172-31-24-170 python3[910]: [E 2019-11-05 11:17:36.251 JupyterHub log:166] {
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Host": "ec2-3-9-174-73.eu-west-2.compute.amazonaws.com",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Content-Length": "19",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Accept-Encoding": "gzip, deflate",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Cache-Control": "max-age=0",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Content-Type": "application/x-www-form-urlencoded",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Cookie": "jupyterhub-hub-login=[secret]; jupyterhub-session-id=[secret]; _xsrf=[secret]",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Origin": "http://ec2-3-9-174-73.eu-west-2.compute.amazonaws.com",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Referer": "http://ec2-3-9-174-73.eu-west-2.compute.amazonaws.com/hub/auth/change-password",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "Upgrade-Insecure-Requests": "1",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "X-Forwarded-For": "77.98.80.79",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "X-Forwarded-Host": "ec2-3-9-174-73.eu-west-2.compute.amazonaws.com",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "X-Forwarded-Port": "80",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "X-Forwarded-Proto": "http",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "X-Forwarded-Server": "ip-172-31-24-170",
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:       "X-Real-Ip": "77.98.80.79"
Nov 05 11:17:36 ip-172-31-24-170 python3[910]:     }
Nov 05 11:17:36 ip-172-31-24-170 python3[910]: [E 2019-11-05 11:17:36.251 JupyterHub log:174] 500 POST /hub/auth/change-password (thomas@77.98.80.79) 25.69ms

@efedorov-dart was this the error that your pull request addressed? It is not obvious to me what exactly the error is here or how to fix it @yuvipanda. I tried messing around with line 53 in firstauthenticator.py but it seems to be an issue with the internals of web.py in the Tornado package, which I am not at all familiar with...

@silhouetted
Copy link

Hi - I realise now I did not understand that users had to enter their password for the first time at logon. I thought they logged in with no password, and then set it once logged in.

Entering their password at the first logon does work.

However, I cannot see a menu to change the password in the Control Panel section for the logged in user, and if I navigate to /hub/auth/change-password I still get the same errors as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Support questions (should be on discourse.jupyter.org instead)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants