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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
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',
username => $username,
password => md5_hex($seed . md5_hex($password)),
type => 'opac',
+ nonce => $nonce
}
);