keppelen / react-facebook-login

A Component React for Facebook Login
1.18k stars 406 forks source link

react-facebook-login not working, after successfull login its redirecting to callback oauth url and give code param in the URI #357

Open Sundaram1911 opened 1 year ago

Sundaram1911 commented 1 year ago

please help, like how we can fetch client user details using that code params what are the steps with sdk we have to follow to get user details. Thanks !

jhunexjun commented 1 year ago

I think you're using mobile browser. The button is executing in a different way on mobile by default. In order not to behave that way, add disableMobileRedirect={true} as part of props in your .

With regards to code url param being returned, you can use that for the following.

GET https://graph.facebook.com/v17.0/oauth/access_token?
   client_id={app-id}
   &redirect_uri={redirect-uri}
   &client_secret={app-secret}
   &code={code-parameter}
GET graph.facebook.com/debug_token?
     input_token={token-to-inspect}
     &access_token={app-token-or-admin-token}

app-token-or-admin-token is your app_id|secret. i.e. with horizontal bar.