Forums de discussion

Authentication with widgets

thumbnail
Vipin Bardia, modifié il y a 8 années.

Authentication with widgets

Regular Member Publications: 162 Date d'inscription: 28/02/11 Publications récentes
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, modifié il y a 8 années.

RE: Authentication with widgets

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
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, modifié il y a 8 années.

RE: Authentication with widgets

Regular Member Publications: 162 Date d'inscription: 28/02/11 Publications récentes
Hi Andrew,

No I didn't try that. Will try and update.
Thanks.
thumbnail
Corné Aussems, modifié il y a 8 années.

RE: Authentication with widgets

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
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, modifié il y a 8 années.

RE: Authentication with widgets

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
BTW please ask questions in the appropriate category for instance
Using Liferay » General
This one is about Marketplace issues
thumbnail
Vipin Bardia, modifié il y a 8 années.

RE: Authentication with widgets

Regular Member Publications: 162 Date d'inscription: 28/02/11 Publications récentes
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, modifié il y a 8 années.

RE: Authentication with widgets

Expert Publications: 467 Date d'inscription: 31/10/11 Publications récentes
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