In the past day, it seems that Facebook has made a big update to their developer UI. Now if I add localhost as an app domain, it gives me the following error:
This must be derived from Canvas URL, Secure Canvas URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains: localhost
API Error Code: 191 API Error Description: The specified URL is not
owned by the application Error Message: Invalid redirect_uri: Given
URL is not allowed by the Application configuration.
The protocol seems to keep changing, and the accepted answer didn't work for me today. In case it helps other searchers, this is what did work for me:
1.) In the center under the first box of options, click "+ Add Platform" and choose "Website" (or whatever is appropriate for your app.)
2.) In the box that comes up for the website you just added: Site URL:
3.) In the box above that (Settings => Basic): App Domain:
4.) At the bottom right - click "Save Changes"
5.) Make sure you have the app ID copied and pasted correctly into your code. (The ID is in the first box on that page if you need it again.)