I have the next problem with the connection:
I can't connect to one app in facebook, but when I create a new app in facebook and I change the API and secret all is going good.
The problem is that I need to connect to the first one app in facebook, the other was only to test the connection.
What could be the solution?
Without any additional information, no one is going to be able to diagnose this with any sort of certainty.
I would suggest checking to make sure that you've set the Facebook app to be classified as a "Desktop app" rather than a web app. If it's not set as a desktop app, Facebook will refuse the connection.
If that doesn't help, you need to provide some more details about the configuration of your app on Facebook and about what exactly you are doing to test the connection.