Facebook Login with REST API

Asked

Viewed 230 times

0

I integrated an Android app with Facebook and can already login there.

Now, I have to integrate that Facebook login with the authentication part of my API. For example, now, what I can do is log in through FB and if it’s all right, I’ll send it to another Activity. But to start consuming API resources, I need the token that is generated by it.

Does anyone know a way to do that?

1 answer

0

After the login response made via Facebook.

You can check if the session is really open, and grab the user token

Example:

Session session = Session.getActiveSession();
if (session.isOpened()) {
    Log.d("token", session.getAccessToken());
}
  • Yes, but this login is valid for Facebook. Not for my REST API, it would have to generate a token for me, correct?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.