turnitin / moodle-mod_turnitintooltwo

Turnitin Direct plugin (version 2) for Moodle
http://www.turnitin.com
31 stars 65 forks source link

Getting Authorization Required when uploading on PHP 7.4 #562

Closed shemgp closed 2 months ago

shemgp commented 4 years ago

If I use PHP 7.4 with Moodle 3.8 stable and try to upload a Turn It In assignment I get Authorization Required in the logs, which doesn't show if I downgrade to PHP 7.3. In PHP 7.3 submission works successfully. Here's a snippet of the PHP 7.4 Turn It In module log:

------------------------------------------------------------
2020-02-27 0:31:55 +0800 - INFO -->
------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header>
    <tns:imsx_syncResponseHeaderInfo xmlns:tns="http://www.imsglobal.org/services/lis/pms2p0/wsdl11/sync/imspms_v2p0">
      <tns:imsx_version>V1.0</tns:imsx_version>
      <tns:imsx_messageIdentifier>802A745A-58B5-11EA-9151-1F8A41019B34</tns:imsx_messageIdentifier>
      <tns:imsx_statusInfo>
        <tns:imsx_codeMajor>success</tns:imsx_codeMajor>
        <tns:imsx_severity>status</tns:imsx_severity>
        <tns:imsx_messageRefIdentifier>02c96644-5c8c-4887-b306-d9bab51cfaa4</tns:imsx_messageRefIdentifier>
        <tns:imsx_description>User successfully updated.</tns:imsx_description>
        <tns:imsx_codeMinor>
          <tns:imsx_codeMinorField>
            <tns:imsx_codeMinorFieldName>TargetEndSystem</tns:imsx_codeMinorFieldName>
            <tns:imsx_codeMinorFieldValue>fullsuccess</tns:imsx_codeMinorFieldValue>
          </tns:imsx_codeMinorField>
        </tns:imsx_codeMinor>
      </tns:imsx_statusInfo>
    </tns:imsx_syncResponseHeaderInfo>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <tns:updatePersonResponse xmlns:tns="http://www.imsglobal.org/services/lis/pms2p0/wsdl11/sync/imspms_v2p0"/>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------------------------------------------------------------

------------------------------------------------------------
2020-02-27 0:31:57 +0800 - INFO -->
------------------------------------------------------------
POST https://api.turnitin.com/api/lti/1p0/upload/submit
Array
(
    [lti_version] => LTI-1p0
    [resource_link_id] => 4ac8428d-dd8d-4776-b7be-acf83c24f316
    [lis_person_sourcedid] => 1089623034
    [lis_lineitem_sourcedid] => 87682341
    [roles] => Learner
    [custom_source] => 12
    [custom_submission_title] => Redemptive Church Discipline
    [custom_submission_author] => 1089623034
    [custom_xmlresponse] => 1
    [custom_widemode] => 0
    [lang] => en_us
    [custom_integration_version] => 2019111801.08
    [custom_plugin_version] => 2019070201
    [oauth_nonce] => 9d8beefe85223338aaf49b2e53de6ffb773f5018
    [oauth_timestamp] => 1582734715
    [oauth_consumer_key] => 82257
    [oauth_signature_method] => HMAC-SHA1
    [oauth_version] => 1.0
    [oauth_signature] => ps5nLqM2IiFN9kU30scd8XIyku4%3D
    [custom_submission_data] => CURLFile Object
        (
            [name] => /var/www/moodledata/temp/turnitintooltwo/1132_Sylvestar_Shangpliang_Redemptive_Church_Discipline_17081_2097031022.pptx
            [mime] => application/vnd.openxmlformats-officedocument.presentationml.presentation; charset=binary
            [postname] => 
        )

)

------------------------------------------------------------

------------------------------------------------------------
2020-02-27 0:31:57 +0800 - INFO -->
------------------------------------------------------------
Authorization required
------------------------------------------------------------

------------------------------------------------------------
2020-02-27 0:31:57 +0800 - ERROR -->
------------------------------------------------------------
Turnitin SDK Exception: responsexmlerror - XML Response could not be parsed
------------------------------------------------------------

Thanks for looking into this bug.

jack-tii commented 2 months ago

Closing this as we no longer support Moodle 3.8. If you are still getting this error in a supported Moodle version, please create a new ticket.