How to link an email account to Facebook in Spring Social? - facebook

I have been some time trying to figure out how to solve this. Let me explain in detail to you.
I'm developing a web app in Spring MVC and Spring Social. By now, users can sigin and signup with Facebook, Twitter and with user/password. Even those users signedin with Facebook/Twitter are able to share.
Now, the webapp owner wants that any user signedup with user/password, he/she can link his/her active account with his/her Facebook profile. This way, those users can post on his/her Facebook wall.
Any of you have an idea about how to accomplish this?
By now, I have tried to get FB token through Graph API http link, but URL shows FB secret property.
Any ideas?

If i am understanding this correctly a very similar scenario is covered in the spring social sample project: https://github.com/spring-projects/spring-social-samples
Once a user is logged into your webapp
They would need to connect to Facebook via spring social (Spring social connect controller would handle this).
They would need to authorize your app to access their facebook.
(spring social does this), After the authentication process you obtain a key that you can keep for the next session.
Once they are logged in, you have an instance of Facebook Connection(spring-social-facebook creates this), and you can use it to post to their wall
connection.updateStatus("I've connected with the Spring Social Showcase!");
There are also other operations you can perform against the Facebook API.
Hope this helps answer your question.
Thanks,
Paul

Related

Login with Facebook Integration With Keycloak using custom login

I am trying to integrate the Keycloak with Facebook social plugin. I had gone through the examples and documentation. This works fine if I use the Keycloak hosted Login Page.
What I need is that we want to host our own login page and use the Keycloak APIs to register the user and login. I mean, I want to host our Sign Up/Login Page.
When the user clicks on the Login with Facebook, we want to redirect the user to FB and get the approval and collect the details, create the user details that we need for our application. Then register the user on the Keycloak.
I don’t see any documentation for this. I would be really grateful if you can shed some light on this and point to the documentation that would help me in achieving this.
Thanks in Advance.
For that I think you have to register your application with facebook using a valid facebook user account to connect with facebook API services.
Refer : https://developers.facebook.com/docs/facebook-login/multiple-providers/

OAuth2, Facebook authentication and a mobile API

I'm developing a mobile API and I would like to allow mobile users to log in to my mobile application using their Facebook account.
I've been struggling to find some detailed information regarding this request. Could someone point me in the right direction? I'm using the following Laravel package for OAuth2:
https://github.com/lucadegasperi/oauth2-server-laravel
As I understand, the user clicks the "Login with Facebook" button and then proceeds to authentication. Facebook provides the access token as a result. But how does a user account appear on our server? And to my knowledge, it is our server that should provide an access token which is tied to the user account on our database. Could someone clear this up?
Have you looked at the Facebook mobile sdk guides?
iOS: https://developers.facebook.com/docs/ios
Andriod: https://developers.facebook.com/docs/android/
The package you mention looks like it performs oAuth authentication, and I don't think you need that. If I understand correctly, you should be able to use the Facebook sdk to perform the authentication and tell your app that the user is authenticated. You will have to create a user account for them (for example, add a record to the users table in your database) and store their Facebook ID.

get Wall Facebook messages without Authentication

Do you know if there is any way to publish on my web app the facebook messages published by the users on my facebook wall application?
I'm using spring social and I tried to use the code you can see below:
facebook.feedOperations().getPosts()
With this sentence, it is launched an exception alerting that Authentication is needed.
Thanks.
Regard
Nope. If you could, then Facebook would need to seriously evaluate their security. The user needs to give you permission to access their data. After authenticating can use the returned user token to access the user's Facebook wall posts.

How do users log in to websites like facebook from some site that supports "share on facebook" features

I'm browsing some news sites and most of them have the option of posting the link on your facebook wall. Or retweeting it. Or to other social media sites.
How do they get the user to authenticate themselves? I just push a button and it asks me to log in, and then it creates a new post on my facebook wall.
I want to reproduce this behavior but don't know where to start.
Read the facebook information for developers here It allows you to create actions that users can do on your site like reading an article or post a photo and it will add it to their facebook profile. There is also the capability for users to register or login to your site using their facebook credentials.
Similarly go here for twitter.
These sites are all using OAuth. It basically involves the transaction of a request for an access token from the site you are logging in through. Your users validate that they approve the validity of your request by authenticating with the third party system such as Twitter or Facebook and then these systems return a token that allows you to read/write/modify user data from these sites on their behalf.

Facebook remember me

I want to implement a "remember me" feature on me website using the facebook connect.
On my website, i have the possibility to do the login by two distinct ways:
Normal login
Facebook Connect
When an user performs the login with facebook connect, even if he logs out on his facebook account, i want to keep him logged in on my website. He will only log out if he clicks on the logout button on the website.
Is there a way to do this?
Thanks in advance
Here is a tutorial using PHP that demostrates how to use Facebook connect. If you read the section about the login page, you'll see that Facebook does some funky javascripting that creates session cookies on your domain based on the login status on Facebook. You might be able to manipulate the API to give yourself the persistance that you're looking for.
Good luck, and hope this helps some in your project.