留言板

Facebook OAuth

Michele Russo,修改在8 年前。

Facebook OAuth

New Member 帖子: 3 加入日期: 14-7-25 最近的帖子
Hi,

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?
thumbnail
Bruno Farache,修改在8 年前。

RE: Facebook OAuth

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
Hi Michele,

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?
Michele Russo,修改在8 年前。

RE: Facebook OAuth

New Member 帖子: 3 加入日期: 14-7-25 最近的帖子
Sorry,
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.
thumbnail
Bruno Farache,修改在8 年前。

RE: Facebook OAuth

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
In order to use the Mobile SDK, the user must exist in the portal. You could pass your own Authentication implementation if you want to do something different, it allows to pass headers to the portal, but this header must be something the portal can use to authenticate the user.
Michele Russo,修改在8 年前。

RE: Facebook OAuth

New Member 帖子: 3 加入日期: 14-7-25 最近的帖子
How implement custom BasicAuthHeaderAutoLogin in order to pass my custom Authentication?

i want signup and login with facebook in my app like i do in my liferay portal

Can you help me?
Marco Fargetta,修改在7 年前。

RE: Facebook OAuth

New Member 帖子: 22 加入日期: 12-1-30 最近的帖子
Hello,

did you find the solution? I have a very similar problem and I would know if you get a way to allow authentication from mobile app using a different authentication source.

Cheers
krishna patel,修改在5 年前。

RE: Facebook OAuth

New Member 帖子: 2 加入日期: 17-12-1 最近的帖子

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?

thumbnail
Javier Gamarra,修改在5 年前。

RE: Facebook OAuth

Expert 帖子: 348 加入日期: 15-2-12 最近的帖子

You should use SessionAuthentication (cookies) or OAuth :)

krishna patel,修改在5 年前。

RE: Facebook OAuth

New Member 帖子: 2 加入日期: 17-12-1 最近的帖子

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.

thumbnail
Javier Gamarra,修改在5 年前。

RE: Facebook OAuth

Expert 帖子: 348 加入日期: 15-2-12 最近的帖子

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).