diff --git a/library/Icinga/Authentication/Auth.php b/library/Icinga/Authentication/Auth.php index e726f1b3a..431a7777c 100644 --- a/library/Icinga/Authentication/Auth.php +++ b/library/Icinga/Authentication/Auth.php @@ -256,6 +256,23 @@ class Auth return $this->user; } + /** + * Set the authenticated user + * + * Note that this method just sets the authenticated user and thus bypasses our default authentication process in + * {@link setAuthenticated()}. + * + * @param User $user + * + * @return $this + */ + public function setUser(User $user) + { + $this->user = $user; + + return $this; + } + /** * Try to authenticate the user with the current session *