Are you developing Facebook apps? Does this picture look familiar to you?
This happens when you’re developing a Facebook application locally using the http://localhost:8080 URL to test your app (or whatever port it’s listening to) and you try to log in using your Facebook account.
I’ll transcribe the error here so this article can be found from search engines more easily:
API Error Code: 191
API Error Description: The specified URL is not owned by the application.
Error Message: redirect_uri is not owned by the application.
The usual workaround
Assuming that your application’s domain is mywebapp.com, your first attempt at circumventing this problem would probably be to add the following line to your /etc/hosts file and comment it out when you’re done testing your app locally:
The main problem with this is that you end up editing the hosts file all the time, which can be pretty inconvenient.
A better approach
A less painful way to fix this is to define an alias just for a subdomain, e.g. local.mywebapp.com, and use that alias instead of localhost when you’re developing locally:
This way, you can test your app locally using http://local.mywebapp.com:8080 and forget about editing the hosts file ever again.