留言板
Facebook OAuth
We have a problem with Facebook OAuth and Liferay on mobile app.
The question is:
how to use Liferay remote services after a login made through Facebook on a mibile app (iOS and Android)?
We have to use FBSession like LRSession in order to call remote services
How we can achieve this?
What's the relation between Facebook authentication and your portal authentication?
Are users using their Facebook credentials to login to the portal? Like described at this blog post?
may be you don't understand my real question or i make the question in a wrong way.
We are developing an app with Liferay mobile SDK.
We use the Liferay SDK mobile (Android, iOS) in this way :
The USER creates his "user" and "password" on our Liferay portal, that we use in Session Impl in order to do our Basic Auth.
E.G.
Session session = new SessionImpl(url, new BasicAuthentication(user, pass));
AddressService addservice = new AddressService(session);
If the user would Sing-up directly with Facabook in our APP,
how can we create our Session without the "user" and "password" ?
Should we use the Facebook Token that we receive from the FB session, or something else ?
Thanks a lot.
i want signup and login with facebook in my app like i do in my liferay portal
Can you help me?
Hi Michele Russo,
I have same problem, How can I Authenticate facebook user via json API. like, when user login via facebook, we don`t have password. so, I can not not use basic Auth. right? so, have you found any solution for that?
You should use SessionAuthentication (cookies) or OAuth :)
Hello Javier Gamarra,
Thanks for the reply.
still, I am not getting how can I implement by sessionAuthentication or OAuth.
Let me clear scenario, I am working in one angular web application. we are just using Liferay REST JSON services of Liferay. for regular login I am using BasicAuth(id:password) in each API request to authorize a user. now, we have customer facebook login module. so, Liferay site handles facebook log in by setting facbookId, token etc in browser session. but, from Rest API how can I identify which user is login. there should be some basicAuth Token or p_auth token in each API request. basic auth is not possible for facebook scenario As Liferay store encrypted autogenerated password in the database. and I am not sure how to get p_auth token from server side. It would be fine if you can help me some example code of any solutions.
Thanks in advance.
Ok, JS, so you are not using the mobile SDK.
Are you inside of Liferay, an angular application served inside of a portlet? if yes, call the local services with the JS SDK (the frontend forum will be more helpful than us).
If you are outside, you will have to send the auth token (Liferay.authToken) but, again, the general/frontend forum will know better, this forum is specific to the mobile sdk (native Java+Swift framework to access the JSON-WS services where you have an automatic Java/Swift way of sending the cookie).