Reputation: 2212
I'm trying to figure out how to use Facebooks OAuth 2.0 server side. I have followed step 1 and redirected the user.
Step 2 is that the user logs in.
Step 3 they get redirected back to my uri with some unique code generated by facebook. This is where I get stuck, as part 4 wants me to send this code to facebook from my server for the User Access Token.
How do I get this unique code sent to my server? Am I suppose to have some javascript that parses it and sends it over a socket to my server? Is there an easier method? Sorry if it's a noob question, I haven't worked with data in url's before.
Thanks for any help.
Upvotes: 0
Views: 226
Reputation: 96424
Step 3 they get redirected back to my uri with some unique code generated by facebook. This is where I get stuck, as part 4 wants me to send this code to facebook from my server for the User Access Token.
How do I get this unique code sent to my server?
You already have it, because it’s part of step 3 that the code gets passed as a GET parameter to your script.
Am I suppose to have some javascript that parses it and sends it over a socket to my server?
Client-side JavaScript for server-side Auth? No, of course not.
If you don’t know how to access query-string/GET parameters in the server-side language you are using, please consult the documentation for it. And if you don’t know how to make an HTTP request and how to interpret the response, please read up on that as well.
Upvotes: 1