I am working on a Rails application which is in development mode and it can register with omniauth.
The host is
http://localhost:3000/
For anyone that is having this issue and the redirect uri provided to instagram is exactly the same as the one you're using, i've found that some users were typing my website address as http://www.example.com/login
when in my instagram api it was http://example.com/login
.
Then I created a php script to detect if the string www
exists in my url and then reload to the same page but without the www
.
if(strpos($_SERVER['HTTP_HOST'], 'www.') !== FALSE) {
header("Location: ".str_replace('www.', '', $_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI']));
}