Answer the question
In order to leave comments, you need to log in
Facebook access token - how to solve the problem?
Hello!
Faced a problem. When I request a token, I get it as a hash tag in response.
How can I get a token as a parameter?
Now I do this:
https://www.facebook.com/dialog/oauth?client_id=[client_id]&client_secret=[secret_key]&redirect_uri=[redirect_uri]&response_type=token
http://me_site.com/fb.html?#access_token=CAAXgUbOqk5kBAKuPxupfOFXeAbV...
Answer the question
In order to leave comments, you need to log in
You understand everything correctly.
You need to use code instead of token.
Once we got the token, we do something like:
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $client_id . "&redirect_uri=" . urlencode($redirect)
. "&client_secret=" . $secret . "&code=" . $code;
// $code - ранее полученный код-токен
$response = file_get_contents($token_url);
//...
// теперь $response содержит ваш токен.
get with javascript and redirect to the same url with GET transmission
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question