I'm totally stuck on this one..
I cant get js sdk or even the oauth link working..
When I try the oauth example, it works just fine:
https://www.facebook.com/dialog/oauth?scope=email,user_birthday&client_id=123050457758183&redirect_uri=http://www.example.com/response/&response_type=token
but in my case:
https://www.facebook.com/dialog/oauth?scope=email,user_birthday&client_id=317872318261965&redirect_uri=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDigiComm%2F185749568187479%3Fsk%3Dapp_317872318261965&response_type=token
the link is basically the same, but get's an error
I've been fighting with this for days.. And can't understand, what could be the problem,
because each time i try to open the auth dialog with js sdk i get this same error..
It must be an error in the app settings on facebook side, but i cant understand what..
I'd say i have the same problem as this guy..
but as i can see he hasnt gotten any answer too:
Using OAuth dialog for facebook app do not allow to use canvas URL as redirect_uri
You need to make sure that the canvas/tab/website URL's in the developer app (https://developers.facebook.com/apps/317872318261965) match the redirect URI in your url.
At the moment, your link is pointing to http://www.example.com - you need to point this to wherever your app is hosted.
try to add http://www.example.com/ with all the slashes as website and example.com as app domain
Update:
If it is a canvas app your redirect_uri should be:
urlencode("http://apps.facebook.com/MY_APP_NAMESPACE/");
Related
I am trying to use facebook oauth in phonegap app http://coenraets.org/blog/2014/04/facebook-phonegap-cordova-without-plugin/
but the issue is my redirect url will be like "file:///" which doesn't seem to be working.
It opens the facebook blank window.
Am I missing anything?
You don't need to explicitly specify the redirect URL in the FBInit(). Just pass the FB App id. The default redirection url is https://www.facebook.com/connect/login_success.html. Add this in your redirection url in FB app Advanced settings.
Importantly make sure you add the inappbrowser core plugin:
cordova plugins add org.apache.cordova.inappbrowser
You should be good to go.
vou have to specify some dumy URL or localhost for redirect_uri and it will work.
Here is facebook oauth example for phonegap:
https://github.com/krisrak/jquery-cordova-oauth2
I also tried this library http://adodson.com/hello.js/#hellojs
, which allows you to specify your re-direct url.
It would be useful in case you have a server and want to know when a user login using your app.
It also seems that if your re-direct url is http://localhost/anything.html you do not even need to have it configured in Facebook. Feels like a bug.
I am trying to add a login button to my website without the js/php sdk, and following the help page for this on the FB dev site it tells me to add
https://www.facebook.com/dialog/oauth? client_id={xxxxxxxxxx} &redirect_uri={http://www.mydomain.com}
to my code but whenever I follow the link it gives me an error saying
The redirect_uri URL must be absolute
I'm pretty sure my url can not get anymore absolute then that, so I think it is an issue with something else but i have not been able to find anything to correct the problem
Did you replace the uri with the one to your site?
https://www.facebook.com/dialog/oauth?client_id=1234567&redirect_uri=www.madderfish.com
My app's domain is thehub.j.layershift.co.uk
In the "App Domains' box, I'm attempting to put: thehub.j.layershift.co.uk
I also have selected Website with Facebook Login and in the Site URL box, I'm trying to put: http://thehub.j.layershift.co.uk/login
Everything works fine with "localhost:8080", while I was testing. What are these domains invalid?
EDIT:
Tried again, still not working. Surely this can't be this difficult???
EDIT AGAIN:
Screenshot: http://i.imgur.com/rGkrZn4.png?1
FINAL EDIT:
Turns out this was an issue was Facebook. After speaking with a support dude over there, he fixed it in about .5seconds. Thanks for the help!
Try the following (worked for me):
In the app domain put layershift.co.uk
In the app URL put http://thehub.j.layershift.co.uk
thehub.j.layershift.co.uk is not a domain - it is a URL. You should try placing only the domain in the domain field.
That would be -
layershift.co.uk
The other parts of the URL (thehub.j) are subdomains of layershift.co.uk.
One more thing that you might want to take a look at is the fact that the URL http://layershift.co.uk is actually being redirected to http://layershift.com. Facebook is not able to retrieve data from that URL while it is being redirected.
With regard to the Site URL, what you'll want to put there is the landing page of your site/application. When you set the Site URL to /login, anyone reaching your application (logged in or not) will be directed to the /login page.
My homepage redirects to the URL listed below to open an oauth dialogue with Facebook to validate user credentials.
<meta http-equiv="refresh" content="0;URL=http://www.facebook.com/dialog/oauth/?client_id=myclientid&redirect_uri=http://www.mywebsite.com/home/index.php" />
The Site URL (Website with Facebook login) in my Facebook App profile is
http://www.mywebsite.com
Everything works great for HTTP but when I recently implemented an SSL certificate I struggled to convert everything to HTTPS (changing HTTP to HTTPS in my redirect URLs and the Site URL in my Facebook app profile. I get the following Facebook error:
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.
I've fought with this a few hours at a time but was never successful and always just changed the redirect URL and the Site URL in my app profile back to HTTP. Last night it worked! I published the code and tested it successfully on two separate computers in both IE and Chrome. This morning I woke up to the same error code I was getting before.
Does anyone have any ideas why my Facebook oauth dialogue seems to be fickle when it comes to HTTPS?
Make sure that you have a valid base domain specified in your app settings.
This is a working example of a website with Facebook connect. At the top I have added a code to:
Detect if the user is authenticated yet and if not it will...
Detect if SSL is being used
If SSL is in use it will check to makes sure that whatever the
current page is (gets dynamically) contains the URL you enter in the
first variable ('$sslurl' in the top settings); otherwise, it will
default back to $sslurl and add whatever page you were visiting to
the end of it.
It will then use the correct url to authorize the user using the
generated SSL url as the redirect_uri
The rest of the script is just a generic website with facebook
connect setup
It's too long to place inside code tags so I put them in a text file here:
http://o-e.us/ssl-facebook-connect.txt
Hopefully it helps, Good luck!
What is wrong here? If a user clicks on the login button he is redirected to http://www.facebook.com/plugins/login.php?action=like&api_key=211295588901671&channel=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df207fe8ecd56db2%26origin%3Dhttp%253A%252F%252F188.24.5.134%252Ff3dedfc22a9c9ac%26relation%3Dparent.parent%26transport%3Dflash&locale=en_US&login_text=&max_rows=1&sdk=joey&show_faces=true&width=200 which gets me to the facebook error Given URL is not allowed by the Application configuration.
I believe it's because the URL the request is made from is not under your Site URL.
Look at your "origin" parameter in the URL you've submitted.
You can only make calls from the location you've defined as your Site URL.
I have used login url in following format
https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream
as per documented in http://developers.facebook.com/docs/authentication/ and it works. I get back request on my web page url provided in application config as mentioned. http://YOUR_URL?code=A_CODE_GENERATED_BY_SERVER
Facebook needs a domain to work properly, so you'll have to register a domain instead of using just your IP. After that, it should work.
Also, post the code you're using, there might be some errors in there too.
Try going to App Settings > Advanced & enable things ending with "Client OAuth Login"; worked here :)