How to solve auth error "Redirect URI does not match registered Redirect URI" in IOS?
I am working on registering a new customer from the instagram developer page for my iphone app. But I have a problem. I created a client id but it gave this error:
{"code": 400, "error_type": "OAuthException", "error_message": "The redirect URI does not match the registered redirect URI"}
Actually, I used this link to connect in ios code:
So I found a sample client id. When I tried trying the client id from this link:
it works well on the same code.
But when ı created Client ID.It doesn't work. I have checked the link . But I haven't resolved this error.
Can anyone help me in creating a new client redirect? or What's my problem?
source to share
For those who have this problem and the uri redirect provided by instagram is exactly the same as the one you are using, I found that some users were typing my website url like http://www.example.com/login
when it was in my instagram api http://example.com/login
.
Then I created a php script to determine if a string exists www
in my url and then reloads to the same page but without www
.
if(strpos($_SERVER['HTTP_HOST'], 'www.') !== FALSE) {
header("Location: ".str_replace('www.', '', $_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI']));
}
source to share