ShopifySharp
ShopifySharp copied to clipboard
Today I have issue with ShopifySharp.AuthorizationService.IsAuthenticRequest
I have couple of Proxy Apps. Today they stopped return true by ShopifySharp.AuthorizationService.IsAuthenticProxyRequest. But I didn't change code more then one year. Do any one have the same problem?
Yes me too! I tried logging and signatures are not matching out of the blue! I have issue with IsAuthenticProxyRequest
I have found the problem. Shopify added parameter logged_in_customer_id for Proxy Apps. If customer is not login in shop, logged_in_customer_id is empty, and method ParseRawQuerystring delete it from dictionary. Thats why signature not equal signature in URL from Shopify
@BorisDNK Did you find any solution? Is it working for you now?
Yes, I'm testing it now
@BorisDNK Okay, If you can share the solution here then it would be helpful for us as well. Thank you in advance.
Solutions is using overloaded methods with Dictinary<string, string>
var queryParams = Request.Query.ToDictionary(keySelector: m => m.Key.ToString(), elementSelector: m => m.Value.ToString());
ShopifySharp.AuthorizationService.IsAuthenticRequest(queryParams, SecretKey);
//and for this method to
ShopifySharp.AuthorizationService.IsAuthenticProxyRequest(queryParams, SecretKey)
But the better way fix value for _querystringRegex in AuthorizationService.ParseRawQuerystring But I cannot quick solve it )
@BorisDNK Thanks for posting the workaround! I'll take a look at fixing the regex.
Fixed in 5.18.2 on nuget!