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

login fails often with username/password #91

Open
gruijter opened this issue Nov 5, 2018 · 10 comments
Open

login fails often with username/password #91

gruijter opened this issue Nov 5, 2018 · 10 comments
Labels

Comments

@gruijter
Copy link

gruijter commented Nov 5, 2018

I do a login 24/7, once an hour, using username/password, at three different schools. For one school the login fails around once every 3 to 4 times. This happens in the test password part:

throw new AuthError(err)

Error: InvalidUsernameOrPassword
at /node_modules/magister.js/lib/magister.js:556:11
at Generator.next ()
at step (/node_modules/magister.js/lib/magister.js:132:191)
at /node_modules/magister.js/lib/magister.js:132:361
at
at process._tickCallback (internal/process/next_tick.js:189:7)

@netlob
Copy link
Contributor

netlob commented Nov 6, 2018

What happens when you do the login from the command line a couple times after each other? (Without changing any code)

@gruijter
Copy link
Author

gruijter commented Nov 6, 2018

then same behaviour. Might be coincidence during my trial, but first login succeeded. Then 10 seconds later I get a timeout on login: Error: FetchError: network timeout at: https://accounts.magister.net/challenge/password
then third time I get Error: InvalidUsernameOrPassword
then fourth time succeeds again, and the same cycle of failure types repeat themselves.

So it seems to go from success > timeout on challenge password > invalid usernameOrPassword

@gruijter
Copy link
Author

gruijter commented Nov 6, 2018

Weird, when I pass the token from the last valid login (in stead of username/password) I seem to get a valid login, but the profileInfo = null.

Trying to login after that with username/password results in invalid usernameOrPassword everytime. And after some minutes waiting, I can login again with username/password.

@lieuwex
Copy link
Member

lieuwex commented Nov 6, 2018

The issue for that token problem is #90

@lieuwex lieuwex added the bug label Nov 6, 2018
@netlob
Copy link
Contributor

netlob commented Nov 6, 2018

Weird, when I pass the token from the last valid login (in stead of username/password) I seem to get a valid login, but the profileInfo = null.

But can you retrieve any other data such as grades and appointments if you login with a token?

I can't cause it gives an error while retrieving the privileges from the login, cause they're null

@gruijter
Copy link
Author

gruijter commented Nov 11, 2018

Could you re-open this issue pls @lieuwex?

@lieuwex
Copy link
Member

lieuwex commented Nov 11, 2018

Oh woops this shouldn't have been closed indeed.

@lieuwex lieuwex reopened this Nov 11, 2018
@gruijter gruijter changed the title login with username/password fails often login fails often (both with username/password and with token) Nov 15, 2018
@gruijter
Copy link
Author

So I installed alpha4, and retested the logging in behaviour.

I now made a scheme where I still login every hour to the three different schools/students, and retrieve some information (grades and lessons mostly). I seperated the time between the three schools/students 10 minutes apart. If I have a token, I will first try to login with the token. If that fails I will try to login with username/password as fallback.

I notice from my logging that when using the token, it also often fails to login (once every 3 to 4 times). This happens for multiple schools.
The behaviour of logging in with username/password seems to be the same: it fails every 3 to 4 times.

In short: the login problem still persists. It seems to fail randomly in about 25-35 % of the attempts. This goes for both the username/password method, as for the token method.

@idiidk
Copy link
Collaborator

idiidk commented Nov 15, 2018

@gruijter that the token fails could be because it expires after some time. Don’t know why the username / password login fails tho. When testing I logged in with and without a token like 2 times a minute and didn’t experience any issues. When I’m home I’ll try to replicate the issue but I can’t really promise anything.

@gruijter gruijter changed the title login fails often (both with username/password and with token) login fails often with username/password Nov 15, 2018
@gruijter
Copy link
Author

@idiidk You might be correct on the token expiration. When looking at my logs so far it seems to fail the second hour after a login. So the token seems to expire after one hour, two hours at most. I think the token handling deserves a seperate issue/feauture request :)

Concerning the failed login: This only happens at one of the three schools, and seems to occur random. I get the following message:

FetchError: network timeout at: https://accounts.magister.net/challenge/password at Timeout. (/node_modules/node-fetch/lib/index.js:1437:13) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) message: 'network timeout at: https://accounts.magister.net/challenge/password', type: 'request-timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants