javadjango-socialauthsocialauth

Socialauth fb access token after login


I have logged in to facebook from my server app and I can get my profile information and contacts etc.

However how can I use this to get the accesstoken that I could use for restfb? Or is there way in socialauth that I can execute FQL, or read the users events list?

List<Contact> contactsList = new ArrayList<>();
    SocialAuthManager manager = socialAuthTemplate.getSocialAuthManager();
    AuthProvider provider = manager.getCurrentAuthProvider();

    contactsList = provider.getContactList();

Current method of getting the contact list.

Thanks


Solution

  • Maybe you can try to use Facebook 4j

    https://developers.facebook.com/docs/reference/fql/

       String query = "SELECT src_big "
                                + "FROM photo "
                                + "WHERE aid IN "
                                + "(SELECT aid "
                                    + "FROM album "
                                    + "WHERE name = " + "\"" + albumname + "\" AND owner IN "
                                        + "(SELECT uid "
                                        + "FROM user "
                                        + "WHERE username = " + "\"" + username + "\"))";
    
    // Single FQL
    mPhotos = facebook.executeFQL(query);