Facebook "cross-domain receiver URL" application error - php

It needs Facebook facepile plugin(http://developers.facebook.com/docs/reference/plugins/facepile). I tried but I am getting this error
(The Facebook Connect cross-domain receiver URL (http://static.ak.fbcdn.net/connect/xd_proxy.php#?=&cb=f223d517566e616&origin=http%3A%2F%2Fpromolife.com.au%2Ff3e13728ba8ec8&relation=parent.parent&transport=postmessage) must have the application's Connect URL (http://www.testsite.com.au/) as a prefix. You can configure the Connect URL in the Application Settings Editor.)
Why do I get this error?

Your connect URL must be the same as the URL you are running the script on & the callback URL. When I say the same I also mean EXACTLY the same in the sense of whether you are using http://yoursite or http://www.yoursite. Double check your app settings to make sure for no typo's in the connect URL also.

Related

Can't authenticate a cURL request despite supplying username and password

I have a dev URL that is behind HTTP authentication using a simple .htpasswd file - nothing special about that at all, all standard.
I am trying to hit a URL on that domain via cURL but am getting this message of course:
Unauthorized
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Apache/2.4.29 (Ubuntu) Server
I have added what I believe to be the correct parameter to authorise the url but with no joy. Just the same message. I have echo'd out the username and password and these are exactly as I would enter into the browser prompt.
What is the next step to debug this?
I have solved this by NOT using curl_setopt_array, instead setting each 3 separately. Cannot currently explain why this is different but it works! :(

Creating a REST API with PHP: getting domainname of request host

So I am working on a API, and I want to check which domainname is requesting information from the API.
So, the client has a cURL script, this script sends a POST request to the server. The server needs to know the domainname of this request.
But I don't know how to check which domainname sended a POST request?
Any idea's?
You can use $_SERVER['REMOTE_HOST']
from the docs:
'REMOTE_HOST'
The Host name from which the user is viewing the current page. The reverse dns lookup is based off the REMOTE_ADDR of the user.
Note: Your web server must be configured to create this variable. For example in Apache you'll need HostnameLookups On inside httpd.conf for it to exist. See also gethostbyaddr().

Coinbase OAuth works on localhost but not on live server

On my live server i'm getting a The redirect uri included is not valid. error message, whereas on my localhost OAuth works ok.
here's the full urls for both:
Localhost:
https://coinbase.com/oauth/authorize?response_type=code&client_id=xxx&redirect_uri=http%3A%2F%2Flocalhost%2Faccounts-coinbase%2Foauth&scope=balance+addresses+user+transactions
Live server (https://example.com)
https://coinbase.com/oauth/authorize?response_type=code&client_id=xxx&redirect_uri=https%3A%2F%2Fexample.com%2Faccounts-coinbase%2Foauth&scope=balance+addresses+user+transactions
I'm pretty confident I had the live server OAuth working before. Any ideas why it's failing now?
Ok I solved my own problem.
The error message, The redirect uri included is not valid. does NOT accurately reflect the issue at all. What was actually the problem is that my Coinbase OAuth app had a localhost redirect url.
The relevant OAuth redirect url, called a "callback url" is set from this rather hard to find page: https://coinbase.com/oauth/applications.
There I just switched localhost with example.com and it worked.

canot establish connection to localhost through facebook application

i have created a new Facebook application and i used the following url as canvas url http://localhost/my_app/
my code works perfectly on localhost, but when i try to cal my application using the following url : apps.facebook.com/leenaaps its displays the following error:
Unable to connect
Firefox can't establish a connection to the server at localhost
what could be the problem exactly?
You most likely do not have a local webserver running. If you do, it might be possible that Facebook uses https:// but you did not configure/enable SSL.
localhost is resolved to ip 127.0.0.1 and this is the local loopback address whcih means it is not routable and cannot be accessed from the internet, So you cannot use it in your canvas url.
You have to use a valid and active domain name like domain.com. If you don't have a public web server you may use some DDNS service, google it some are free

Openfire add user using URL

I am trying create users on openfire using a url link but for some reason I'm getting an error.
I've installed the plugins and opened the right port, but I'm getting
RequestNotAuthorised errors.
This is the link I am referring to:
http://www.nkstream.com:9090/plugins/userService/userservice?type=add&secret=bigsecret&username=kafka&password=drowssap&name=franz&email=franz#kafka.com
Go into the Server > Server Settings > User Service and enable the user service. You will also find the secret key there. You will need to replace the "bigscret" in the URL with the secret key found in the area I just specified.
You can use "User Service" plugin: you can find it in the section plugin on your Openfire server.
Once installed:
Server -> Server Settings -> User Service
enable 'user service request' and note 'secret key'.
To create new user you can use PHP directly or using php wrapper for the plugin.
If you want you can use directly cURL from command line, it could be usefull for someone:
URL="http://<your_server>:<your_port>/plugins/userService/userservice"
PARAMETERS="secret=<yourSecretKey>&type=add&username=<user>&password=<psw>&name=<name>&email=<mail>"
curl ${URL}?${PARAMETERS}
If everithing works, you should receive:
<result>ok</result>
You receive
<error>RequestNotAuthorised</error>
because secret must be the FIRST parameter.
I've never used openfire so this is a stab in the dark. Based on the README, RequestNotAuthorised is returned if:
the secret does not match
the requester IP is invalid
Have you set the secret key (bigsecret) in the User Service page in the Openfire admin console?
Is there a setting for allowed IPs where you can specify your IP?

Categories