nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
742 stars 309 forks source link

Encoding On redirect_uri #1094

Open StrangeWill opened 2 weeks ago

StrangeWill commented 2 weeks ago

In BuildAuthorizationUrl whatever URL we pass in is not URI encoded automatically, the documentation also does not suggest that we need to, however oauth spec seems to require that we URL encode our parameters (which makes sense, otherwise if we use query strings or the like in our redirect_uri, it'll clearly break)

Should this be handled by ShopifySharp or should our documentation be updated to suggest to follow spec?

nozzlegear commented 2 weeks ago

Hey! You're correct that it's not currently handled by ShopifySharp. What I've always done is just encode it myself before passing it to ShopifySharp, but I don't think that's very intuitive. If ShopifySharp is creating the final authorization uri, it makes sense that it'd be responsible for encoding the query parameters since it controls what goes into the query string.

At the very least, I could add a boolean to configure whether ShopifySharp should encode the query params or not.