I'm trying to create a custom login portlet for liferay because I also need to do some other things such as logging. However the problem I've stumbled on is that the portal-impl.jar seems to be shielded off so I can't use the loginutil class. Now I don't want to modify how the actual login works so this is quite a bummer. I've read something about being able to use something like ext(the explanation was quite vague) but that didn't seem like the cleanest solution.
I've got some experience at developing portlets, but I'm new at developing for liferay.
creating an "ext plugin", as it is called, is the best way to solve your problem. This part of the documentation should be your first step.
First, you should identify in the portal.properties the properties to modify : be it another autologin in the pipeline, or an action triggered by the login action. I often use the first one for custom SSO actions, and the latter for auditing purposes.
Then create an ext plugin with your custom class (extending loginutil, for example) and create embed the portal-ext.properties needed to reference it.
That way, you should be able to have a clean package to deploy and undeploy ; customizing the jsps of the login portlet can also be done.
Arnaud
Why do you want to use the LoginUtil class?
If you really just want to add logging to the login you can maybe just create a post-login hook. This hook will intercept each user login so you can do your custom logic such as adding some logging with the user's information.
The advantage of this approach is that your code is completely separated from Liferay.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With