Skip to content
Snippets Groups Projects
Unverified Commit aeb32e1b authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #22992 from nextcloud/password-urlencode

allow authenticating using urlencoded passwords
parents 08cc9ad4 63dc2df6
No related branches found
No related tags found
No related merge requests found
...@@ -5160,7 +5160,8 @@ ...@@ -5160,7 +5160,8 @@
<code>$this-&gt;createUserFromBackend($uid, $password, $backend)</code> <code>$this-&gt;createUserFromBackend($uid, $password, $backend)</code>
<code>$this-&gt;createUserFromBackend($uid, $password, $backend)</code> <code>$this-&gt;createUserFromBackend($uid, $password, $backend)</code>
</NullableReturnStatement> </NullableReturnStatement>
<UndefinedInterfaceMethod occurrences="4"> <UndefinedInterfaceMethod occurrences="5">
<code>checkPassword</code>
<code>checkPassword</code> <code>checkPassword</code>
<code>countUsers</code> <code>countUsers</code>
<code>createUser</code> <code>createUser</code>
......
...@@ -231,6 +231,20 @@ class Manager extends PublicEmitter implements IUserManager { ...@@ -231,6 +231,20 @@ class Manager extends PublicEmitter implements IUserManager {
} }
} }
// since http basic auth doesn't provide a standard way of handling non ascii password we allow password to be urlencoded
// we only do this decoding after using the plain password fails to maintain compatibility with any password that happens
// to contains urlencoded patterns by "accident".
$password = urldecode($password);
foreach ($this->backends as $backend) {
if ($backend->implementsActions(Backend::CHECK_PASSWORD)) {
$uid = $backend->checkPassword($loginName, $password);
if ($uid !== false) {
return $this->getUserObject($uid, $backend);
}
}
}
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment