Question

I am working on facebook application in java, and i succeed to retrive the access_token.

Now i want to pull for example the user feed but i dont have the user id https://graph.facebook.com/userid(or me)/likes?access_token=...

Yes, I know user id could be replaced by 'me', but my app is a web app, user just input his user name and password in our frame, not facebook OAuth Dialog which is for user authentication and app authorization, so I think facebook should do not know who is me, so I need user uid. In previous implementation, I could use user email and password to get user id and session key by Facebook Rest API, but how could I get it by Graph API by user name and password?Is there a way to do that?

Was it helpful?

Solution

The Graph API uses OAuth 2.0 for authorisation.

One of the main goals of OAuth is that the user's credentials don't have to be handed out to the 3rd party applications.

So, it's not possible to get the user id and session key using the Graph API with just the users email & password (unless you logged them in manually yourself).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top