Answer the question
In order to leave comments, you need to log in
How to save the access_token received from VK?
I use the PHP SDK library to work with the Vkontakte API. The documentation says:
After successful authorization, the browser will redirect the user to the specified redirect_uri. access_token will be sent as a fragment to the address you specified:
For user access key
https://example.com#access_token=533bacf01e11f55b5...
$vk = new VKApiClient();
$response = $vk->users()->get($access_token, array(
'user_ids' => array(1, 210700286),
'fields' => array('city', 'photo'),
));
Answer the question
In order to leave comments, you need to log in
JavaScript document.location.hash
https://www.w3schools.com/jsref/prop_loc_hash.asp
So that instead of the # sign , the parameters are passed with the ? you need to use not the Implicit flow, but the Authorization code flow .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question