title: HMAC-SHA256 issue in Shopify oauth (Output does not match)
body: <p>I'm trying to publish an app on Shopify marketplace by following <a href="https://docs.shopify.com/api/authentication/oauth" rel="nofollow">this</a> documentation. And I'm stuck on step-3 of the oauth documentation wherein you have to do 'HMAC Signature Validation'.</p>
  
  <p>Documentation states that you have to process the string (specified below) through HMAC-SHA256 using app's shared secret key.</p>
  
  <pre><code>String = "shop=some-shop.myshopify.com&amp;timestamp=1337178173"
  </code></pre>
  
  <p>I'm trying to implement the steps using Java. Following is gist of the code that I have used.</p>
  
  <pre><code>        private static final String HMAC_ALGORITHM = "HmacSHA256";
          String key = "hush";
          String data = "shop=some-shop.myshopify.com&amp;timestamp=1337178173";    
          SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(),HMAC_ALGORITHM);
          Mac mac = Mac.getInstance(HMAC_ALGORITHM);
          mac.init(keySpec);
          byte[] rawHmac = mac.doFinal(data.getBytes());
          System.out.println(Hex.encodeHexString(rawHmac));
  </code></pre>
  
  <p>The code produces the following string:</p>
  
  <pre><code>c2812f39f84c32c2edaded339a1388abc9829babf351b684ab797f04cd94d4c7
  </code></pre>
  
  <p>Through some random search on Shopify developer forum I found the link to a <a href="https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/hmac-verification-using-php-278811" rel="nofollow">question</a>.</p>
  
  <p>The last message from <a href="https://ecommerce.shopify.com/users/367749" rel="nofollow">@Shayne</a> suggests that we have to make changes in <code>data</code> variable by adding <code>protocol</code> field.</p>
  
  <p>But it didn't work out :(</p>
  
  <p>Can anyone tell me what should be done?Do I have to make modifications in my code or the process in the documentation have changed.
  Please help.</p>