掲示板

Using LoginUtil in portlet

11年前 に Edvinas Bazaras によって更新されました。

Using LoginUtil in portlet

New Member 投稿: 7 参加年月日: 12/06/27 最新の投稿
Hello everybody,

How do I use LoginUtil's inside my custom portlet?
Now if I try to use this, I get freakin' class not found exception... what the hell?

What do I want:
Simple task PRESS THE BUTTON -> LOGIN;

I will repeat this slowly, please don't ask why I need this:
1) Me open liferay portal
2) Me see da login buttonzzz
3) Me click da button
4) Me iz logged in!

Is it clear enough? Click -> Logged in;
Why can't you have such a simple example?

Rhetorical question for the end: does liferay makes you swear?
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Using LoginUtil in portlet

Liferay Legend 投稿: 14917 参加年月日: 06/09/02 最新の投稿
LoginUtil is an internal part of Liferay and is not exposed to external plugins.

You might think this is a bad thing, but it does ensure that you don't inadvertently drop a plugin into your installation that allows a remote user to automagically log in (i.e. when the new marketplace goes live, and you get a 'free' plugin for playing solitaire but it's actually a trojan the remote hacker can now use to log into your Liferay environment).

Perhaps rather than posting your "kewl kid" speak, you could formulate a post indicating what you're trying to do and what you're struggling with. Or even try searching the forums since there have been many posts lately dealing with customizing the login portlet...

Answer to rhetorical question: No, Liferay doesn't make me swear, but some posts on the forum do...
11年前 に Edvinas Bazaras によって更新されました。

RE: Using LoginUtil in portlet

New Member 投稿: 7 参加年月日: 12/06/27 最新の投稿
Sorry for harsh tone in my first post, but its insane when I find hundreds of posts with the same problem I am struggling at and no working solution...

I will describe as clear as possible what do I want:
1) I want to create kinda empty portlet with single jsp page and button like:
<h1>Hello World</h1>
<form method="GET">
<input type="hidden" name="doYouWantToLogginWithoutPasswordAndUserName" value="yes"/>
<button>CLICK ME TO LOGIN </button>
</form>

2) I want to click that button

3) After clicking that button I really need to be logged in without user name and password.

Some preconditions: -lets say I am going to hard-code username and password inside MyMagicLoginAction;

and... lets say we check "doYouWantToLogginWithoutPasswordAndUserName" value inside MyMagicLoginAction;
if it is "yes" we, are logged in.

Btw, I am dealing with LR 6.1 GA1;
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Using LoginUtil in portlet

Liferay Legend 投稿: 14917 参加年月日: 06/09/02 最新の投稿
I'm sure I haven't see hundreds of posts with people trying to do a fake login, but that's neither here nor there...

The only way you're going to be able to access LoginUtil is via an EXT plugin (that's how you merge code into the portal core).

Although it is said to be deprecated, you should be able to create your portlet within the EXT plugin project and deploy it that way.
11年前 に Edvinas Bazaras によって更新されました。

RE: Using LoginUtil in portlet

New Member 投稿: 7 参加年月日: 12/06/27 最新の投稿
Fake log-in is the key to make any other kind of log-in.

Correct me if I am wrong, but are you telling me that log-in portlet(inside portal-impl jar) is liferay's core feature and can be overridden in no other way, but ext plugin?

Is it the same if I want to create some new "dummy" user by using GET method like: ?action=CREATE_ME_USER_PLEASE&username=my_name&hash=SOME_SIGNATURE_TO_CHECK_VALIDITY

In short: is user creation core feature as well and can only be overridden with ext plugin?
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Using LoginUtil in portlet

Liferay Legend 投稿: 14917 参加年月日: 06/09/02 最新の投稿
User creation can be done using the UserLocalServiceUtil functionality outside of EXT, in fact any plugin can do it.

Overriding the login portlet JSP can be done using a hook, and does not require an EXT plugin.

However, if you want to create your very own login portlet (which your post seemed to indicate), you would need to do that via an EXT plugin in order to be able to access the LoginUtil functionality.
11年前 に Edvinas Bazaras によって更新されました。

RE: Using LoginUtil in portlet

New Member 投稿: 7 参加年月日: 12/06/27 最新の投稿
Thank you for clear answers.
Looks like I found the right solution with your help,
I appreciate that.
Have a nice day. emoticon