SIP login nonce
authorBill Erickson <berick@esilibrary.com>
Tue, 8 Oct 2013 19:58:56 +0000 (15:58 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 10 Oct 2013 16:50:11 +0000 (12:50 -0400)
Since multiple SIP clients may use the same credentials, avoid the
same-username race condition to authentication by applying a login nonce
value.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/SIP.pm

index 46e9290..8098d84 100644 (file)
@@ -227,9 +227,10 @@ sub login {
     my( $self, $username, $password ) = @_;
     syslog('LOG_DEBUG', "OILS: Logging in with username $username");
 
+    my $nonce = rand($$);
     my $seed = $U->simplereq( 
         'open-ils.auth',
-        'open-ils.auth.authenticate.init', $username );
+        'open-ils.auth.authenticate.init', $username, $nonce );
 
     my $response = $U->simplereq(
         'open-ils.auth', 
@@ -238,6 +239,7 @@ sub login {
             username => $username, 
             password => md5_hex($seed . md5_hex($password)), 
             type     => 'opac',
+            nonce    => $nonce
         }
     );