'Authorisation Failure' during testing

After attempting a number of permutations, it’s time to reach out for help.

This is the request payload that we’re sending:

<?xml version="1.0" encoding="UTF-8"?>
<GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
  <EnvelopeVersion>2.0</EnvelopeVersion>
  <Header>
    <MessageDetails>
      <Class>Accounts</Class>
      <Qualifier>request</Qualifier>
      <Function>submit</Function>
      <TransactionID>1775723637048089996</TransactionID>
      <GatewayTest>1</GatewayTest>
    </MessageDetails>
    <SenderDetails>
      <IDAuthentication>
        <SenderID>[clear text AND MD5 versions of CH provided presenter ID]</SenderID>
        <Authentication>
          <Method>clear</Method>
          <Value>[clear text AND MD5 versions of CD provided presenter code]</Value>
        </Authentication>
      </IDAuthentication>
    </SenderDetails>
  </Header>
  <GovTalkDetails>
    <Keys>
      <Key Type="CompanyNumber">[clear text CH provided test company ID]</Key>
    </Keys>
  </GovTalkDetails>
  <Body>
    <FormSubmission xmlns="http://xmlgw.companieshouse.gov.uk/Header">
      <FormHeader>
        <CompanyNumber>[clear text CH provided test company ID]</CompanyNumber>
        <CompanyAuthenticationCode>[clear text CH provided test company auth]</CompanyAuthenticationCode>
        <FormIdentifier>Accounts</FormIdentifier>
      </FormHeader>
      <Document>
        <Category>ACCOUNTS</Category>
        <Data>[encoded in Base64 string]</Data>
      </Document>
    </FormSubmission>
  </Body>
</GovTalkMessage> 

The Gateway is consistently sending back the following with no additional information provided:

   <RaisedBy>Accounts</RaisedBy>
   <Number>502</Number>
   <Type>fatal</Type>
   <Text>Authorisation Failure</Text>

If anyone can shine some light on the situation we’d be very grateful.

Kind regards, Lee

Note, when we submit an MD5 version of the presenter ID we get:

Invalid testmode selected. You must use a test efiling presenter account and set the test mode.

So either we’re past the ‘Authorisation Failure’ but we’re using the wrong credentials (live instead of test) or it doesn’t recognise our presenter ID anymore.

Neither is particularly clear from the error messages received thus far.

For anyone who finds themselves in this position in the future:

Using the Presenter credentials obtained via the website should not be used in testing mode.

Testing Presenter credentials are obtained by emailing Companies House.