[SalesForce] use an OAuth 2.0 token for API Integration in Enhanced Packages in the Soap API fueloauth token header

In Salesforce marketing cloud I have an installed package with an API integration. I am in the process of moving from the old OAuth token created via https://auth.exacttargetapis.com/v1/requestToken to the new OAuth 2 token created via https://mcc289rsykf7bklym5hlwv5n40n4.auth.marketingcloudapis.com/v2/token

I am using the client credentials server to server integration type.

The new OAuth 2 token generated works correctly via any of the REST API endpoints however it doesn't work with the old soap web service when passed in the <fueloauth>TOKEN_HERE</fueloauth> soap header. This does work correctly with the old OAuth token.

Here is an example of the soap call that I am testing with. Like I said this works correctly with tokens generated via https://auth.exacttargetapis.com/v1/requestToken

<?xml version="1.0" encoding="UTF-8"?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
      <fueloauth>TOKEN_HERE</fueloauth>
    </soapenv:Header>
    <soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
           <RetrieveRequest>
              <ObjectType>DataExtensionObject[DE-KEY]</ObjectType>
              <Properties>CustomerKey</Properties>
              <Properties>Name</Properties>
              <Properties>Keys</Properties>
              <Properties>Type</Properties>
              <Properties>ModifiedDate</Properties>
              <Properties>CreatedDate</Properties>
           </RetrieveRequest>
        </RetrieveRequestMsg>
      </soapenv:Body>
    </soapenv:Envelope>

The error I receive back is "User not authorized" the soap fault is below:

            <faultcode>soap:Client</faultcode>
            <faultstring>User not authorized</faultstring>
            <faultactor>https://mcc289rsykf7bklym5hlwv5n40n4.soap.marketingcloudapis.com/Service.asmx</faultactor>
            <detail>
                <apifault xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:fault.partner.exacttarget.com">
                    <Code>11</Code>
                    <Message>User not authorized</Message>
                </apifault>
            </detail>
        </soap:Fault>

Its worth noting that I have enabled every permission available in the API integration.

Has any one experienced any similar issues or have an idea how to fix this issue?

Best Answer

I had a email exchange with a contact I have in the salesforce marketing cloud team and I was specifically told that the enchanced package support isn’t complete yet for AppExchange partners and we should continue to use the legacy endpoints until further comms to AppExchange partners says otherwise.

I don’t know what that means for other people how are having a similar issue. We are building an app for the AppExchange so this was relevant to me.

Once I receive further communication regarding the readiness of the enchanced package support I will update this answer.