Add extra logging for when user logs in with a temp password
authorBrian Wolff <bawolff+wn@gmail.com>
Sun, 13 Nov 2016 05:11:49 +0000 (05:11 +0000)
committerBrian Wolff <bawolff+wn@gmail.com>
Sun, 13 Nov 2016 05:13:03 +0000 (05:13 +0000)
It would be good to keep better track of this in the logs

Change-Id: I7f33b45f83034bfa1c003c149e92917b2f045988

includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php

index 9962fa3..2e6f93c 100644 (file)
@@ -154,6 +154,16 @@ class TemporaryPasswordPrimaryAuthenticationProvider
                        return $this->failResponse( $req );
                }
 
+               // Add an extra log entry since a temporary password is
+               // an unusual way to log in, so its important to keep track
+               // of in case of abuse.
+               $this->logger->info( "{user} successfully logged in using temp password",
+                       [
+                               'user' => $username,
+                               'requestIP' => $this->manager->getRequest()->getIP()
+                       ]
+               );
+
                $this->setPasswordResetFlag( $username, $status );
 
                return AuthenticationResponse::newPass( $username );