An active access token must be used to query information

Support » Plugin: Nextover Social Login and Register » An active access token must be used to query information


Resolved
*
shukindigo

(

Hello.I have sầu followed the steps that you have sầu provided in the first reply found here : https://nayaritas.net/support/topic/rest-api-social-login-work-flow/

However I am getting the following error for facebook login:

An active access token must be used khổng lồ query information about the current user.

Bạn đang xem: An active access token must be used to query information

I have checked the access token via https://graph.facebook.com/me?access_token=xxxxxxxxx & I got the name and ID information.

Using other chạy thử access tokens (obtained via fb dev access token tool) also returned the aforementioned error.

I have even tested via your demo form found here : https://gist.github.com/nextend/4d3c701c8d99972824025e4dfdeccac0 and again, it returned the same error.

Please help me on this.


Viewing 3 replies - 1 through 3 (of 3 total)
Plugin Support
*
Laszlo

(
laszloszalvak)


1 year, 3 months ago


Hi
shukindigo

If the access token is actually fine, then I assume your problem will be related lớn the format you post it.I am not really sure but you are probably posting only the “access_token” value, but no the whole JSON encoded access token as I suggested here:https://nayaritas.net/support/topic/rest-api-social-login-work-flow/#post-12026347

If this is the problem, then please make sure, you JSON encode the whole access token what the provider returns, so it should look something like:"access_token":"xxxxxxxxx","token_type":"bearer","expires_in":5183946Here you can see an example for both the Facebook và Google access_token: https://gist.github.com/nextend/b733d402ee2e2cee59b632f6e4741a9d

Best regards,Laszlo.

Xem thêm: 3 Cách Kiểm Tra Card Đồ Họa Máy Tính Có Card Đồ Họa Hay Chưa?


Thread Starter
*
shukindigo

(
shukindigo)


1 year, 3 months ago


Hi.

I did actually posted the whole parameters in the json.

Also, I’ve sầu tested with your test-form where there is text field for access token, still the problem persist. I got the same error.

Is it something to lớn do with any other setup?My nayaritas.net is located in a subdirectory, could it be a cause?


Plugin Support
*
Laszlo

(
laszloszalvak)


1 year, 3 months ago


Hi
shukindigo

nayaritas.net installations in subfolders should not cause such problem.But I assume something isn’t quite right with your access token. I just checked the chạy thử form, with the JSON encoded access_token token of the Facebook provider và the size worked fine for me, when there was a user registered with the posted access_token it returned the User ID fine.

Xem thêm: Stand Back Là Gì - Stand Back In Vietnamese

What I would suggest you to:1.) Login to lớn your demo Facebook account, go khổng lồ Settings > Apps & Websites > find the App you are testing with then Remove it. This will revoke your access_token.2.) Once it is done, go to lớn your nayaritas.net site, delete the test nayaritas.net account that your kiểm tra Facebook account is linked with. ( This is just khổng lồ make sure, your demo nayaritas.net tài khoản is not linked with a Facebook tài khoản over another Facebook App. )3.) Then you should register a new nayaritas.net tài khoản with your Facebook tài khoản.4.) After that log out of the nayaritas.net account.5.) Open this file:

wp-content/plugins/nextend-facebook-connect/includes/oauth2.php

find this code:$this->access_token_data = $accessTokenData;in the authenticate() function around line 144 & add this code after it:eđến wp_json_encode($this->access_token_data);exit;6.) Try khổng lồ connect with the Facebook provider again. It will write out your access token.7.) Copy this access token and test it with the REST API test size.8.) If this works fine, then compare the structure of the working access token with the wrong access token.9.) Don’t forget to lớn remove the custom code that writes out the access token, once you finished the debugging!

Anyway please note that we can not provide tư vấn for problems related to lớn custom coding, but hopefully this will help you in solving the problem.