AnsweredAssumed Answered

Getting 20014 - Authentication failed error

Question asked by 33471 on May 3, 2013
Latest reply on May 3, 2013 by 22662

     Hi Guys,

     I just started using Marketo API. Created simple client for accessing leads. I have followed the documentation to create my request. SOAP request is as follows.

     <?xml version='1.0' encoding='UTF-8'?>
     <soapenv:Envelope xmlns:soapenv="">
             <ns1:AuthenticationHeader xmlns:ns1="">
             <ns1:paramsGetLead xmlns:ns1="">

     The mktowsUserId and URL Endpoint are correct, I have checked it. I am using following code to generate signature

         public static String calculateHMAC(String data, String timeStamp, String key)
             String result;
             try {
                 SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), HMAC_SHA1_ALGORITHM);
                 Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM);
                 String signatureData = timeStamp.concat(data);
                 byte[] rawHmac = mac.doFinal(signatureData.getBytes());
                 result = DatatypeConverter.printBase64Binary(rawHmac);            
             } catch (Exception e) {
             throw new SignatureException("Failed to generate HMAC : " + e.getMessage());
             return result;


     I am not sure what is wrong, Could you guys please check my request and signature generation method are correct or not?