LP#1384740 MARC stream (etc) use auth nonce
authorBill Erickson <berickxx@gmail.com>
Wed, 24 Jun 2015 15:00:25 +0000 (11:00 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 4 Nov 2015 20:32:41 +0000 (20:32 +0000)
Add an authentication nonce to the shared oils_header.pl file to avoid
too-many-logins by a single username causing login rejections.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/support-scripts/oils_header.pl

index 6dc6be6..d0a1870 100755 (executable)
@@ -155,15 +155,16 @@ sub oils_login {
 
        $type |= "staff";
 
+       my $nonce = rand($$);
        my $seed = $apputils->simplereq( $AUTH, 
-               'open-ils.auth.authenticate.init', $username );
+               'open-ils.auth.authenticate.init', $username, $nonce);
        err("No auth seed") unless $seed;
 
        my $response = $apputils->simplereq( $AUTH, 
                'open-ils.auth.authenticate.complete', 
                {       username => $username, 
                        password => md5_hex($seed . md5_hex($password)), 
-                       type => $type });
+                       type => $type, nonce => $nonce });
 
        err("No auth response returned on login") unless $response;