留言板
Authentication with widgets
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 -
How can I authenticate users in case of widgets?
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?
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?
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?
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é
BTW please ask questions in the appropriate category for instance
Using Liferay » General
This one is about Marketplace issues
Using Liferay » General
This one is about Marketplace issues
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
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