--- loncom/lti/ltiutils.pm 2017/12/09 16:24:03 1.2 +++ loncom/lti/ltiutils.pm 2017/12/30 14:04:00 1.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA LTI interactions # -# $Id: ltiutils.pm,v 1.2 2017/12/09 16:24:03 raeburn Exp $ +# $Id: ltiutils.pm,v 1.3 2017/12/30 14:04:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -319,15 +319,18 @@ sub verify_lis_item { # sub sign_params { - my ($url,$key,$secret,$paramsref) = @_; + my ($url,$key,$secret,$sigmethod,$paramsref) = @_; return unless (ref($paramsref) eq 'HASH'); + if ($sigmethod eq '') { + $sigmethod = 'HMAC-SHA1'; + } my $nonce = Digest::SHA::sha1_hex(sprintf("%06x%06x",rand(0xfffff0),rand(0xfffff0))); my $request = Net::OAuth->request("request token")->new( consumer_key => $key, consumer_secret => $secret, request_url => $url, request_method => 'POST', - signature_method => 'HMAC-SHA1', + signature_method => $sigmethod, timestamp => time, nonce => $nonce, callback => 'about:blank', @@ -444,7 +447,7 @@ sub get_tool_lock { # sub release_tool_lock { - my ($cdom,$cnum,$marker) = @_; + my ($cdom,$cnum,$marker,$name) = @_; # remove lock my @del_lock = ($name."\0".$marker."\0".'lock'); my $dellockoutcome=&Apache::lonnet::del('exttools',\@del_lock,$cdom,$cnum);