Redirecting to the authentication dialog - "An error has occurred. Please try again later."

Why does this always happen to me?

This happens after my application checks the user's user login and redirects the user to the authentication page:

https://www.facebook.com/dialog/oauth?client_id=XXX&redirect_uri=http%3A%2F%2Fexample.com%2Fmyappname%2F&state=YYYYYY&scope=offline_access%2Cpublish_actions

Instead of showing the login page, Facebook shows the error page

An error has occurred. Please try again later.

Is there any configuration that I have to do before trying to authenticate my users?

Everything is done using PHP using the PHP-SDK classes.

+49
php facebook facebook-graph-api
Aug 29 '11 at 15:03
source share
34 answers
  • one
  • 2

I had the same problem after changing the domain of my site. Although I changed the request_uri parameter correctly and updated my application settings in the new domain, the error continued. Then I realized that my Facebook APP SECRET identifier and identifier automatically changed without warning! All this started working again using the new identifier.

+38
Nov 16 '11 at 15:58
source share

I had the same problem as you.

On the Facebook Developer Apps page, make sure Sandbox mode is turned off.

enter image description here

+64
Feb 08 '12 at 0:00
source share

This happened to me, but all the keys, secrets, etc. were correct. I found that my application is running in sandbox mode. Go to your application settings in https://developers.facebook.com/ , go to the advanced settings tab and check if your application is in sandbox mode. If it is disabled and try again. Let us know if this works.

+16
Dec 12 '11 at 18:31
source share

I was getting this error because I started with http://mysite.com , but indicated http://WWW.mysite.com in my Facebook settings - this was important for WWW ... I decided to solve using .httpaccess to always kill "www", and hover the FB at http://mysite.com

worse. subdomain. Ever.: And)

+7
Feb 14 '12 at 7:52
source share

When working with Dialogues, Facebook provides the attribute 'show_error', which by default is no , but can be set to true in the development environment and is really useful for debugging purposes.

show_error. If this parameter is set to true, the error code and description of the error will be displayed in case of an error.

Instructions for using it can be found in Facebook Docs .

I debugged "An error has occurred. Please try again later." before I find this attribute in the docs. As soon as I started using it, I could see the following message:

API Error Code: 191

API Error Description: The specified URL does not belong to the application

Error message: redirect_uri does not belong to the application.

+7
Apr 12 '13 at 9:48
source share

I had the same problem; it turned out that for FB the string appID is required, but not int ...

 //DOESNT WORK: $facebook = new Facebook(array( 'appId' => 147XXXXXXXXXXX, 'secret' => 'XXXXXXXXXXXXXX', )); // WORKS: $facebook = new Facebook(array( 'appId' => '147XXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXX', )); 
+5
Dec 31 '11 at 19:20
source share

For me, this happened because the ā€œtest userā€ I created was part of a separate application. I created a test user for this application, and it started working fine.

It's stupid of me, I know, but it can save someone else some trouble.

+5
Nov 08 '12 at 19:59
source share

Make sure your application is configured to use the appropriate URL and domain of your site. Perhaps this is.

+3
Aug 29 2018-11-11T00:
source share

According to OAUTH Dialog documentation:

* redirect_uri: The URL to redirect after the user clicks a button in the dialog box. The specified URL must be a URL with the same base domain that is specified in the settings of your application, the canvas URL of the form https://apps.facebook.com/YOUR_APP_NAMESPACE ... *

I am building oauth links dynamically to ask the user for additional permissions if necessary, and I realized that even if you are redirected to https://apps.facebook.com/YOUR_APP_NAMESPACE you must have the application domain and website settings, installed in your application administration. I set the domain to facebook.com and the website for the root facebook url.

Now my link to the oauth dialog works fine - even in sandbox mode.

+3
Apr 05 2018-12-12T00:
source share

I had this exact problem in a page-tab app, and for me life couldn’t decide what the problem was. It worked on my test page, but as soon as I did it live it didn't work. In the end, I found that I fixed the problem by placing the actual URL on the Page tab (i.e. http://www.facebook.com/<"page_name">/app_<"app_id"> ) in " Site URL "under" Website ". That doesn't make any sense. But it worked :-)

+3
Apr 11 '12 at 15:59
source share

The solution for me is to set the "Verified Referrals" option to enable. This is really fixed after that.

Fix permissions error

+3
Oct 03
source share

The problem was solved after I updated the "appID" and "secret", and then transferred the changes back to the hero (ie - "git click" hero master ")

The key is not to forget to return the changes to the hero of the master. It is very easy to overlook if you use localhost for testing.

Hope this helps.

+2
Feb 22 '12 at 10:13
source share

For me, the problem was that the Facebook users that I used to test the application did not receive their email address verified by Facebook.

My client created 2 fake Facebook accounts and told me they didn’t work. But he forgot to confirm the email addresses of these accounts (emails sent by Facebook went to his spam folder and he didn’t notice).

It took me a few hours to find this, so I hope this helps someone.

Hurrah!

+2
Sep 12
source share

There was also a problem with the wrong redirect link: I had a link starting with "https://apps.facebook.com?myapplication" .... but after logging in, the redirect will lead me to "apps.facebook.com/Myapplication", and therefore, I would get the message described above: "An error has occurred. Try again later." because "apps.facebook.com" means "http://apps.facebook.com/Myapp" and not "https: //apps.facebook.com /, ..."

Solution: go to the settings of my application in the facebook developers section. Click "Edit." In the left menu, ā€œPermissionsā€ is selected (by default the menu is set to ā€œBasicā€), and in the newly opened parameter set, my ā€œAuthentication Token Parameterā€ has changed from ā€œRequest Stringā€ to ā€œURL Fragmentā€.

It worked! Upon completion of authorization, users are taken to "https: //apps.facebook.com/myapp ..."

+2
Nov 07 '12 at 11:15
source share

Another possible error, if you copied the code from the example Facebook SDK, you may get the same error, even though everything is correct. http://developers.facebook.com/docs/reference/php/

This is because in their example, they used backquotes instead of single quotes for the array key. The correct code is as follows.

 require_once("facebook.php"); $config = array(); $config['appId'] = 'YOUR_APP_ID'; $config['secret'] = 'YOUR_APP_SECRET'; $config['fileUpload'] = false; // optional $facebook = new Facebook($config); 
+2
Nov 18 '12 at 21:33
source share

If your code works correctly to remove this type of error, go to the Facebook developer app and turn off sandbox mode .

+2
Jan 01 '13 at 14:49 on
source share

I myself ran into this problem. I am developing the application internally, so my host is "localhost". It was not obvious how to set "localhost" in the application configuration. If you want to develop locally, configure your application by following these steps:

  • Go to the place where you control your Facebook application. In particular, you want to be in "Basic" in the "Settings" menu.
  • Add "localhost" to the "application domain".
  • In the "Choose how your application integrates with Facebook" section, select "Website" and enter "http: // localhost /".

Save and wait a couple of minutes for the dissemination of information, although it worked right away for me.

+1
Apr 18 '12 at 15:56
source share

I set a restriction on an app that can only use the app to live in the United States. I was working in Canada at the time this error message appeared. After removing the restriction, everything worked.

+1
Aug 23 '12 at 13:45
source share

Came here with a similar problem, and, yes, my sandbox was included. I turned it off and, voila, the login problem disappeared. I must warn you that this problem does not affect website developers and administrators, as Facebook allows these users to see the application. For this reason, I could not even believe that users complained about the impossibility of logging in, since I was able to log in without problems.

+1
Nov 16
source share

I had the same problem and fix it by adding param & display = touch for the url

try it can help

+1
Feb 27 '13 at 10:08
source share

Reply for 2015

Sandbox mode has disappeared.

Go to My Apps -> Your App -> Status & Review and change the slider to ā€œYesā€ for:

Do you want to make this application and all its live features available to the general public?

enter image description here

+1
Aug 26 '15 at 15:18
source share

If you are an application developer, you may see a more specific error message, but usually this message means one of two things:

  • Your server returned an HTTP error code (usually 5xx)
  • You tried to send the user after entering a URL that is not allowed by the configuration of your application (although as an application administrator in this case you should see a more specific error message and Facebook error code)
0
Aug 29 '11 at 17:05
source share

I had this error because I used redirect_url as a parameter instead of redirect_uri .

The Server-Side Authentication page reports that redirect_url is being used:

 https://www.facebook.com/dialog/oauth? client_id=YOUR_APP_ID &redirect_url=YOUR_REDIRECT_URI &scope=COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES &state=SOME_ARBITRARY_BUT_UNIQUE_STRING 

But this is not true. The OAuth Dialog doc says that redirect_uri used instead, so I assume that you can use only one and not the other:

 https://www.facebook.com/dialog/oauth/? client_id=YOUR_APP_ID &redirect_uri=YOUR_REDIRECT_URL &state=YOUR_STATE_VALUE &scope=COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES 
0
Mar 20 '12 at 19:16
source share

You need to specify http:// in your REDIRECT URI.

0
Apr 08 '12 at 19:26
source share

I have tried all the answers mentioned here. But that did not work. I had to delete and create again. I guess this was due to the new ā€œAuthenticated Referralā€. If you add Open Graph objects that have not been approved, this may result in an error.

0
Apr 09 2018-12-12T00:
source share

I had the same problem and the main reason was different:

I registered as a test user of another application. Therefore, I could not resolve the application that was not created for the test user.

When I logged out and logged in as a regular user or test user for the application that I was trying to resolve, everything was fine.

0
Jul 05 2018-12-12T00:
source share

In my case, there was a problem with the account used with the application.

If the FB application has alcohol content, FB users who are younger than about 21 will cause an error when trying to log in with it.

0
Oct 17 '12 at 15:36
source share

For me, the problem was that the application URL did not fully match the URL on which I ran it (for example, in different directories, in the same domain)

0
Oct 30 '12 at 10:55
source share

There is no way to resolve this type of error. So it’s better to use your own dialogue as shown on facebook, and send messages again and again without logging in. Despite the fact that you remove your application from facebook, you can request a login and send a message successfully.

0
Mar 30 '13 at 13:33
source share

The reason in my case was completely different. I tried to open the Feed dialog automatically after loading the page. And 9 times out of 10 this error was displayed. First, I added the show_error: true parameter suggested by @Peter Roome, but that didn’t help, displaying 104: Invalid signature , not descriptive at all.

Then I understood the reason. The code was in the $(document).ready jQuery function. And it seems that some things on facebook were not uploaded at that moment when the code was supposed to be executed. I moved the code to the $(window).load (which runs after loading the entire contents of the page), and the problem was resolved.

0
Aug 26 '13 at 18:59 on
source share
  • one
  • 2



All Articles