留言板

Authentication with widgets

thumbnail
Vipin Bardia,修改在8 年前。

Authentication with widgets

Regular Member 帖子: 162 加入日期: 11-2-28 最近的帖子
Hi Folks,

I am trying to use liferay widgets into salesforce and want to display authenticated user's data.

I am using below JS to embed widgets in my another site -

<script src="https://abc.com/html/js/liferay/widget.js" type="text/javascript"></script>
<script type="text/javascript">
	Liferay.Widget({ url: 'https://abc.com/widget/web/lr/home/-/hello_INSTANCE_RIZ2TlJMaoM9'});
</script>


How can I authenticate users in case of widgets?
thumbnail
Andrew Jardine,修改在8 年前。

RE: Authentication with widgets

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Hi Vipin,

I've never done this before but have you tried passing the credentials in the url? Even if just to see whether or not that actually works?
thumbnail
Vipin Bardia,修改在8 年前。

RE: Authentication with widgets

Regular Member 帖子: 162 加入日期: 11-2-28 最近的帖子
Hi Andrew,

No I didn't try that. Will try and update.
Thanks.
thumbnail
Corné Aussems,修改在8 年前。

RE: Authentication with widgets

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
Vipin Bardia:

How can I authenticate users in case of widgets?


Hi Vipin,

Basically you have to be logged in to the Liferay Instance that you receive the Widget from.

Place your widget on a private page or site and you are automatically send to login screen:

Its simply proven: if you are logged in to this Liferay Instance with the same browser before calling the widget url you should be logged in as wel in the widget ( it shares the same cookie/session.

So its all about how do you want to be known in a Widget, as a know user or as a generic user.
Do you want Widget Users first to login to Liferay or do you want them to be auto logged in as some generic user: Any of the auto login hooks should be able to help you in last case.

auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.FacebookAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin 


More complex and best with Salesforce would be to use SAML authentication.

Good luck.
Corné
thumbnail
Corné Aussems,修改在8 年前。

RE: Authentication with widgets

Liferay Legend 帖子: 1313 加入日期: 06-10-3 最近的帖子
BTW please ask questions in the appropriate category for instance
Using Liferay » General
This one is about Marketplace issues
thumbnail
Vipin Bardia,修改在8 年前。

RE: Authentication with widgets

Regular Member 帖子: 162 加入日期: 11-2-28 最近的帖子
Hi Corné,

Thanks for your inputs.
Will try to go with SSO.

Apologies for using the wrong category. I did it by mistake. Will take care of that in future.
thumbnail
Sushil Patidar,修改在8 年前。

RE: Authentication with widgets

Expert 帖子: 467 加入日期: 11-10-31 最近的帖子
Hi,

If i got your requirement correctly. You can use OAuth for authentication.Following link may be help full for you.
https://dev.liferay.com/discover/portal/-/knowledge_base/6-1/exporting-portal-applications-as-widgets-and-opensocial-gadgets
https://www.liferay.com/marketplace/-/mp/application/45261909
https://dev.liferay.com/discover/portal/-/knowledge_base/6-2/oauth

Regards