Search code examples
facebook-opengraphfacebook-graph-api

Facebook Graph API Explorer behind HTTP Basic Auth


I keep getting the following error when I try to test one of my pages with Graph API Explorer:

{
  "error": {
    "message": "(#3502) Object at URL https://example.com/place/123456-Something has og:type of 'website'. The property 'bar' requires an object of og:type 'example:bar'.  (http response code: 401)", 
    "type": "OAuthException", 
    "code": 3502
  }
}

The problem is that this page is behind HTTP Basic Authentication and it returns 401 Unauthorized even if I pass proper credentials to authenticate for this page. I can't believe it but this seems to me that Graph API Explorer does not support HTTP Basic Authentication. Does anyone had this issue before and know how to force Graph API Explorer to be able to authenticate?


Solution

  • If the scraper (https://developers.facebook.com/tools/debug) cannot reach your page then it's not possible.

    Open Graph pages must be public and reachable.

    Using self-hosted objects requires that you host them as pages on your own webserver and all self-hosted objects are public.

    https://developers.facebook.com/docs/opengraph/using-objects/