Skip to content

Conversation

@ChristophWurst
Copy link
Contributor

@ChristophWurst ChristophWurst commented Jun 24, 2016

I found an inconsistency of login hooks while working on #25154.

  1. hooks were triggered twice (once in login and then in loginWithToken)
  2. the post login hook in login was called without tranlating a possible token password to the login password
  3. when logging in a disabled user via token no LoginException was thrown (the login was still blocked, but resulted in a 401 instead)
  4. when logging in via token there was no check whether an app aborted the login process via the post login hook

Needs rebase once #25154 was merged. done

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @icewind1991, @DeepDiver1975 and @blizzz to be potential reviewers

@ChristophWurst
Copy link
Contributor Author

ChristophWurst commented Jun 27, 2016

Note for reviewers: loginByPassword handles the process of logging in by password, loginByToken handles the token login process. Hence they should perform the same checks.

@ChristophWurst
Copy link
Contributor Author

ChristophWurst commented Jun 27, 2016

  • TEST: LoginException is thrown in case a user was disabled
  • TEST: login with password works
  • TEST: login with token works
  • TEST: preLogin hook triggered for password logins
  • TEST: preLogin hook triggered for token logins
  • TEST: postLogin hook triggered for password logins
  • TEST: postLogin hook triggered for token logins

@guruz
Copy link
Contributor

guruz commented Jun 27, 2016

Code looks OK, I have not tested it.
👍

@ChristophWurst
Copy link
Contributor Author

this fixes token login for clients, which seems to have issues on current master (see failing integration tests of other PRs). @DeepDiver1975 @PVince81 @icewind1991 review please

}

$this->loginWithToken($password);
$user = $this->getUser();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the return statement is missing on master, hence the return false; below is executed and the login is considered to have failed.

@ChristophWurst
Copy link
Contributor Author

PHPDoc added and postLogin hook moved accordingly.

@PVince81
Copy link
Contributor

👎 looks like token auth is broken. Works fine on master.

@PVince81
Copy link
Contributor

Wait, I forgot to pull

@PVince81
Copy link
Contributor

Tested with ext storage that uses post login for user provided creds (had to rebase onto master for that), both password and token login work and the ext storage can be accessed in both cases

👍

@DeepDiver1975 DeepDiver1975 deleted the login-hooks branch June 27, 2016 20:16
@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants