Getting Intermittent Facebook API Error Code: 191
Did you integrate Facebook Login Authentication in your website and you intermittently get a report from users of a "An error occurred. Please try again." message from Facebook?
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_url: Given URL is not allowed by the Application configuration.
How to solve this:
1. Make sure your site URL specified in the app settings in Facebook match the one you are using in the redirect_uri. Don't use specific pages in the URL, just the domain like:
site url: http://www.yoursite.com
2. All above looks fine and it works for you, but you seem to be getting the problem intermittently? I found this to be the problem: Some users were going to http://yoursite.com instead of http://www.yoursite.com. Facebook was rejecting all requests coming from a non-www domain for my site.
There are various articles on the web for how to configure your server to redirect non-www urls to www urls. It's also always good practice to make your site search-engine friendly. Hope that helps.