galen / PHP-Instagram-API

PHP 5.3+ wrapper for the Instagram API
338 stars 159 forks source link

Configurable authorization functions #50

Open caje731 opened 9 years ago

caje731 commented 9 years ago

While authenticating a user and fetching the access token, the functions currently do not accept parameters that override the initial config. This can be a hassle when you'd want to change the config at runtime. For example, if the specified redirect_uri in the config is www.my_redirect.com, I'd want to pass some data to the redirect handler, to allow dynamic behaviour, like so : www.my_redirect.com?q=runtimeValue which would help the redirect handler logic to behave differently.

These commits parameterize the functions to allow this behaviour.

caje731 commented 9 years ago

ping @galen

GreatPotato commented 9 years ago

I'm having the exact same issues, modifying the redirect_uri always gives a "Redirect URI doesn't match original redirect URI" error.

I'm having to work around this currently by saving the states in session before redirecting, and them reading them on return. Works, but not the most efficient way.

caje731 commented 9 years ago

@GreatPotato yes, that's the same issue I faced, which made me create this pull request.

@galen I'm pretty sure many others would have encountered this problem, working around it in their own ways. That's why I think it'll be nice to have this commit merged. Will ease a lot of similar problems.