How to server side login using facebook and google?

my meteor app evolve to server side only now. so everything will be server side using rest api.

I need to login using social media on server side only.

this is example of payload :

{
"type" : "facebook",
"token" : "SOME_FB_TOKEN_HERE"
}

Google login :

{
"type" : "google",
"token" : "SOME_GOOGLE_TOKEN_HERE"
}

it will return :

{
"meteor_auth_token": "METEOR_AUTH_TOKEN_FOR_AUTHORIZATION"
}

how to do that in server side?

Can you show more of your client side code and the method you have to receive it on the server?

Are you using the accounts packages from meteor?