Foros de discusión

Authentication Portlet

Michel Knight, modificado hace 7 años.

Authentication Portlet

Junior Member Mensajes: 34 Fecha de incorporación: 29/09/14 Mensajes recientes
Hi,
Using Liferay 6.2
Using the default Authentication portlet provided by liferay.

Is there a way to redirect to a specific page after clicking on Login?
Is there a way to redirect to a specific page if the user belong to a specific group?(I have only 2 group).



Thanks,

Michel
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Authentication Portlet

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
Yes to both.

For the first one, in the control panel you can define the default landing page. This will be where you end up after login.

For the second one (and really any other custom landing page action you want to have), check out the DefaultLandingPageAction which is a post login hook to send the user to a specific page post login. You can check the group membership and route user as necessary or you can use any rules you can think of to direct the user to an appropriate place.
Michel Knight, modificado hace 7 años.

RE: Authentication Portlet

Junior Member Mensajes: 34 Fecha de incorporación: 29/09/14 Mensajes recientes
I don't mind building another Form do duplicate what the "Authenticate portlet " does.
It would have been to nice...

I have build a Form where I've got my to field(username and password) but what to do when I click on submit?
1.Not sure which API I should be looking...
2. I've look at the UserLocalServiceUtile ->authenticateByUserId....
3. But then what once I've authenticate the user is it the same as if would have used the Login portlet? I'm log in?

A bit lost on how to achieve this, I would appreciate some guidance.

Michel
Michel Knight, modificado hace 7 años.

RE: Authentication Portlet

Junior Member Mensajes: 34 Fecha de incorporación: 29/09/14 Mensajes recientes
Many thanks David, we must have been writing at the same time... I will look at your answer tonight ... I'm facing a tight schedule, your input is greatly appreciated.

MIchel
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Authentication Portlet

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
So it is not easy to create your own login portlet, primarily because the LoginUtil class and methods (leveraged by the OOTB login portlet) are not visible for external users to invoke directly.

When folks have done it, they usually have to use reflection to invoke the method in the portal's class loader. Works, but you should only go this route if you need to.

Just to have your own landing page action, though, is no reason to undertake building out a login portlet. Leverage out the DefaultLandingPageAction class to build out your own landing page redirect and you'll get all the functionality you need without going through that extra headache...
Michel Knight, modificado hace 7 años.

RE: Authentication Portlet

Junior Member Mensajes: 34 Fecha de incorporación: 29/09/14 Mensajes recientes
Hi David,
Appreciate the input, agree with your approach the goal of portlet is to re-use them not rebuild.
Everything is working fine.

Just a last question regarding the Look, I've already looked at the configuration of the Authentication(portlet)-> apperance.
In my case I would just like to add a custom footer to the portlet and change the color of the Button (blue to Orange), is there an easy way to achieve this?

Michel
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Authentication Portlet

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
blue -> orange would be a theme change, you can inspect the current border to see what the rule is and craft an override just for the login portlet.

Adding a custom footer to the portlet would be a JSP hook. You'll want to clone the current JSP file into your hook and then add your message in the appropriate place.
Michel Knight, modificado hace 7 años.

RE: Authentication Portlet (Respuesta)

Junior Member Mensajes: 34 Fecha de incorporación: 29/09/14 Mensajes recientes
emoticon

Michel