I want to share 2 ways for making solution. Hope it will solve your issue.
Solution 1:
Facebook now roles some features as plugins. In the left hand side select Products and add product. Then select Facbook Login. Pretty straight forward from there, you'll see all the Oauth options show up.
OR,
Select Products and add product. Then select Facbook Login.
Then added http://localhost:3000/ to the field 'Valid OAuth redirect URIs', and then everything worked.
Solution-2:
It usually happens if you have entered the wrong details when you created the App in Facebook. Or have you changed a URL's of an existing App?
Can you please recheck the settings of your APP in this page?
https://developers.facebook.com/apps
- Select the correct App and click in the edit button;
- Check the URLs & paths are correctly entered and are pointing to the
site where you have installed Ultimate Facebook plugin.
Credit goes to Lei lionel
UPDATE1:
I think your access token already expires. So you need to extend access token.
For this, please go through this link:
- Extend Facebook access token (make it 60days last)
- Expiration and Extension of Access Tokens
Resource Link:
- Generate "never-expire" access token for Facebook Page
- Do Facebook Oauth 2.0 Access Tokens Expire?
UPDATE2:
I just want to ask 1 thing more is it possible the app domain error
has smthng to do with access token expiration time?
Ans:
Generating Long-Lived User Tokens from Server-Side Long-Lived Tokens
Facebook has an advanced option for obtaining long-lived access tokens for apps that:
- Have their own authentication system (using a username/password for
example)
- Store, on their servers, a Facebook access token for people using it
that they send to different clients (browser or native mobile apps)
- Make API calls from all of those clients
If your app is set up like this it should use the process described here to obtain an access token from each client to avoid triggering Facebook's automated spam systems. The end result will be that each client will have its own long-lived access token.
At a high level, this is how you can obtain a long-lived token from the client:
- Make a call to Facebook's server from your server using a valid and
current long-lived token to generate a code. (This assumes you've
already obtained a long-lived token via Facebook Login. If the token
you're using is invalid or expired, you'll have to obtain a new one
by making the person using your app log in again.)
- Securely send that code to the client.
- The client then exchanges the code for a long-lived token.
- The client can use the long-lived token to post stories or query
data.
Getting the code
Using a long-lived user access token, make a call to the following endpoint:
https://graph.facebook.com/oauth/client_code?access_token=...&client_secret=...&redirect_uri=...&client_id=...
You need to give input: access_token, client_secret, redirect_uri and client_id.
Response will be:
The response will look something like:
{"code": "...."}
Redeeming the code for an access token
Once you've retrieved the code from Facebook's server you then need to ship it to the client via a secure channel. Once that's done, you need to make a request from the client to this endpoint:
https://graph.facebook.com/oauth/access_token?code=...&client_id=...&redirect_uri=...&machine_id= ...
The call requires the following arguments:
client_id - Yes
code - Yes
redirect_uri - Yes
machine_id - No
The response will look like:
{"access_token":"...", "expires_in":..., "machine_id":"..."}