CURL and PHP to connect user with Facebook app [closed] - ajax

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
receiving the Facebook username and password of our users via SMS we want to connect them with our Facebook app by using PHP and CURL only.
I got the CURL working to login the user and to navigates to the Facebook App Center.
But now, can anyone help me I to make the ajax url call using cURL and setting the variables to their proper values?
Many thanks in advance!
I used Firebug to get the http request header(example):
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Connection keep-alive
Cookie datr=uwFOULplg04OUafUhiZ0HuH3;
fr=01N5ffPgbtXUfTSbp.AWXd1IvmHVuGxr9GDRK9hpoYg
7g.BQTgHg.-8.AWXCZ9aq; lu=Rg6On5bhniBKFnROJOb7OApg; locale=en_GB;
c_user=100002533085804; csm=2; s=Aa5wBFIhYob4hVne.BQiowf;
xs=61%3AaaoKTpJSVJO6PA%3A2%3A1351257119; act=1351265044404%2F0%3A2; p=6;
presence=EM351265035EuserFA21B02533085804A2EstateFDsb2F0Et2F_5b_5dElm2
FnullEuct2F1351256551BEtrFA2loadA2EtwF1590615573EatF1351264924097G3512
65035755CEchFDp_5f1B02533085804F1CC; sub=34605056
Host apps.facebook.com
Referer https://apps.facebook.com/thefind/?fb_source=search&fb_appcenter=1
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
X-SVN-Rev 656775
and the variables with their values:
__a 1
__user 100002533085804
filter[0] app
filter[1] page
filter[2] group
filter[3] friendlist
lazy 1
token v7
viewer 100002533085804

You should not be collecting your user's password to log them in! This is a TOS violation and is a poor practice.
Instead, if you want to do this in PHP, you should be using the server side login method to authenticate your user. Once they complete this process, they will have authenticated your app.

Related

How do you disallow same-origin access but allow strict cross-origin? [duplicate]

This question already has answers here:
Why isn't my CORS configuration causing the server to filter incoming requests? How can I make the server only accept requests from a specific origin?
(1 answer)
CORS-enabled server not denying requests
(2 answers)
CORS allowed-origin restrictions aren’t causing the server to reject requests
(3 answers)
Closed 1 year ago.
Say I have a server abc:8080
and a website web.org that make requests to abc:8080..
I only want abc:8080 to be accessible through web.org..
Users are disallowed from navigating to abc:8080 without being on the allowed origin 'web.org'.
Is this possible?
django-cors-headers specific answer would be awesome!
From what I understood is that your abc:8080 is acting as a backend server providing APIs and web.org is let's say your frontend server consuming those APIs.
I assume you have django-cors-headers installed on abc:8080
Adding web.org to django settings variable CORS_ALLOWED_ORIGINS in 'abc:8080' project should do the job
CORS_ALLOWED_ORIGINS = [
"web.org",
]

Web API 2 Caching [duplicate]

This question already has answers here:
What's default value of cache-control?
(6 answers)
Closed 6 years ago.
We have a requirements that some Web API responses should never be cached .
When we checked the headers in the response of a Web API 2 calls , we found that there is no Cache-Control headers.
Does this mean that Web API 2 results are not cached by default or do we need to send the header Cache-Control : no-cache , no-store will every response to ensure that results are not cached
It's not cached by default.
If you want to use caching,you need to write logic or include libraries for it.

WP 8.1 Push notifications - Invalid Client Secret [duplicate]

This question already has answers here:
Where i can obtain client secret for my Universal app?
(2 answers)
Closed 6 years ago.
I'm following this guide (msdn.microsoft.com/library/windows/apps/hh465407) to implement push notifications on my app, but it seems to be outdated since I can't find the client secret as shown in this image (https://msdn.microsoft.com/dynimg/IC737349.png).
If I try to register using the password i can generate at (https://apps.dev.microsoft.com), I get an error message.
Request:
POST /accesstoken.srf HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: https://login.live.com
grant_type=client_credentials&client_id=ms-app%3a%2f%2fS-1-15-2-3747961549-[...]&client_secret=[???]&scope=notify.windows.com
Response:
{
"error": "invalid_client",
"error_description": "Invalid client secret"
}
So, where to find this client secret?
You must login into the microsoft dev dashboard, create a new app (you don't have to load a .xap file, you just need to put in a name and all those stuffs...)
After that, click on the app you just created: on the left, select "services" from the menu and then click on the "push notification" link.
Finally, on the page you will see now, click the "live services website" link that you will see on the second text paragraph. you should now see a page with your secret code.
let me know if you resolved the problem, cheers!

J2ME HTTPS Connection Problem: Certificate was issued by an unrecognized entity [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Certificate was issued by an unrecognized Entity
I am developing a little J2ME application that will read our grades from our university's server. With Desktop Applications, It is fine, I can do it but in J2ME, it always gives me this error, even I use well-known services like HTTPS Google, I still get the same error.
urlConn = (HttpsConnection) Connector.open("https://stars.bilkent.edu.tr/srs/ajax/login.php");
urlConn.setRequestMethod(HttpsConnection.POST);
urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
o = urlConn.openOutputStream();
// Sending my POST requests to server
input = urlConn.openDataInputStream();
In the last line I always get the error I mentioned above. What should I do about it?
Anyways, the problem is with the J2ME Emulator, Works perfect on the phone.

Configuring Firefox 3.0.x to send a Kerberos token [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
I'm trying to convince Firefox 3.0.14 to send a Kerberos token. I have configured the service correctly and IE will send a Kerberos token (i.e. starting YI..), but after adding the hostname to the network.negotiate-auth.trusted-uris and network.negotiate-auth.delegation-uris settings in about:config, Firefox only sends an NTLM token. Here's the (cut down) output from Live Headers:
to server ->
GET /testsso.jsp HTTP/1.1
<- from server
HTTP/1.x 401 Unauthorized
WWW-Authenticate: Negotiate
to server ->
GET /testsso.jsp HTTP/1.1
Authorization: Negotiate TlxxxxxxxxQ=
<- from server
HTTP/1.x 401 Unauthorized
WWW-Authenticate: Negotiate
The server is only interested in a Kerberos token, i.e. one starting in YI, so issues the Unauthorized on the second request, at which point Firefox gives up.
I'm using Windows 2003. Any thoughts?
J
Kerberos is disabled on a default firefox.
You can enable it, check out the guide here:
http://grolmsnet.de/kerbtut/firefox.html

Resources