Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Return correct loginname in credentials,
even when token is invalid or has no password.

Returning the uid as loginname is wrong, and leads to problems when
these differ. E.g. the getapppassword API was creating app token with
the uid as loginname. In a scenario with external authentication (such
as LDAP), these tokens were then invalidated next time their underlying
password was checked, and systematically ceased to function.

Signed-off-by: Lionel Elie Mamane <[email protected]>
  • Loading branch information
Lionel Elie Mamane committed Jun 20, 2020
commit f7f053b101f32efda5059872a4b155aea4d3ea21
2 changes: 1 addition & 1 deletion lib/private/Authentication/LoginCredentials/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getLoginCredentials() {

if ($trySession && $this->session->exists('login_credentials')) {
$creds = json_decode($this->session->get('login_credentials'));
return new Credentials($creds->uid, $creds->uid, $creds->password);
return new Credentials($creds->uid, $this->session->get('loginname'), $creds->password);
}

// If we reach this line, an exception was thrown.
Expand Down