Login with Facebook Integration With Keycloak using custom login - facebook

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/

Related

How to get Instagram direct API authentication

Facebook recently released a step-by-step documentation for using a GrapAPI to manage Instagram messages. To obtain the access token to use it, it's necessary to create an application in the developer center, enable login via Facebook and include the permissions "instagram_basic", "instagram_manage_messages" and "pages_manage_metadata" but to activate these options it's necessary to submit various information for approval as statement of how the integration works and descriptions of the usage flow. I don't have access to this information because I can't develop an integration without it being approved.
It's not possible to use the provided test user as the pages raised by him cannot be linked to Instagram accounts.
Tutorial followed: https://developers.facebook.com/docs/messenger-platform/instagram/get-started
Someone with some experience with the Facebook API could give me a light on how to obtain the token with access required and proceed the tests?
I have done the tutorial as well, I faced the same problem. To enable instagram_basic, instagram_manage_messages and pages_manage_metadata without app review you need to create a test-app. For test apps all permissions are granted without review.
Instructions on how to create a test-app
Another usefull tipp: If you are wondering why you need to implement facebook login to access the instagram messaging api, the logic is the following: You need to implement login to then use your own implementation to logg in your own account and obtain the page access key that will let you do api calls to the instagram messaging api. This process is obviously overkill and instagram is working on a way of getting that access token through the developer dashboard.
For now to obtain that access token you need:
implement facebook login as a simple html website and console log the response. Be sure to add the required permissions to the data-scope attribute of the facebook login button:
<div
class="fb-login-button"
data-scope="public_profile,email,instagram_basic,instagram_manage_messages,pages_manage_metadata,pages_messaging"
></div>
deploy to a website that has https enabled (logging in from
localhost will only work if you use a tunelling service like ngrok).
Open your website that has facebook login implemented and logg in with your facebook account that is also linked to the target instagram account and also is admin of your test-app.
get the access token from the response to call the other API endpoints.

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

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

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.

How to integrate Facebook into WordPress registration/login?

Here's what we hope to accomplish: a WordPress site that will allow users to register/login EITHER with Facebook OR WordPress and have the same access to posts/pages/content. From all the research thus far, this doesn't seem trivial...
Here's our requirements:
User Registration
Facebook
New users can connect with Facebook by clicking a button and then granting the requested permissions to our Facebook App. The permission-grant is a one-time event.
They will have to log into Facebook if they aren’t already.
When they connect for the first time a WordPress account will automatically be created for them. This integrates Facebook and WordPress.
This free plugin may be a good starting point to integrate the two systems - http://wordpress.org/extend/plugins/simple-facebook-connect/
Here’s another one that only handles the WordPress account creation based on a Facebook session. What it’s lacking is the ability to use the Facebook session to login after registration (it requries the WordPress username/password). http://wordpress.org/extend/plugins/facebook-registration-tool/
WordPress
If the users doesn’t have a Facebook account or chooses not to connect through Facebook, they can manually create a WordPress account.
Required fields are: username, email, password
User Login
Facebook
If the user has already granted permissions to our Facebook App, they will be auto-logged-in if they have an active Facebook session and visit our website.
Otherwise, the user will have to first log in to Facebook.
WordPress
The user can choose to login with the username/password they created.
Any words of wisdom on how we can accomplish these requirements?
After several trials, the best plugin for this kind of job is http://wordpress.org/extend/plugins/social-connect/ It covers not only Facebook but also Twitter, WordPress.com and Google
Here you can find some details on installing it http://giannopoulos.net/2011/12/28/how-to-add-facebooktwitteretc-authentication-on-wordpress/
Facebook supports OpenID.
There is an OpenId plugin for Wordpress I know nothing about.
http://wordpress.org/extend/plugins/openid/
The best plugin which integrates Facebook (and also Twitter and Google Plus) is WordPress Social Login.
Definetly https://wordpress.org/plugins/wp-facebook-login/ . Lightway and secure.
There's a plugin I use on a BuddyPress site named socialsnapin which I think should fulfill your criteria (although I haven't tested it with plain WordPress).
try with keywords on wordpress.org :- facebook login. social login, facebook connect
There are more and awsome plugins for do this.
best i have tried:-
FacebookAll (with all facebook social plugins) By sourceaddons

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.