Foren

Get request in Authenticator hook

thumbnail
Ken Driscoll, geändert vor 11 Jahren.

Get request in Authenticator hook

Junior Member Beiträge: 57 Beitrittsdatum: 02.07.12 Neueste Beiträge
I created a hook implement the Authenticator class, to perform some additional checks when the user tries to log in. Now, I need to redirect the user to a different page under certain conditions. So my question is, is there any way to get the current request parameter from the Authenticator class to set a redirect? For instance, a Util class? I would need a method, or series of methods, which don't initially require another request parameter, because the Authenticator methods aren't passed that.

Thanks in advance.
thumbnail
Mika Koivisto, geändert vor 11 Jahren.

RE: Get request in Authenticator hook

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
You can't redirect from Authenticator as it's not designed for that. There's only three possible responses from Authenticator: success, failure or does no exist
thumbnail
Ken Driscoll, geändert vor 11 Jahren.

RE: Get request in Authenticator hook

Junior Member Beiträge: 57 Beitrittsdatum: 02.07.12 Neueste Beiträge
That's what I was afraid of. Is there any way to access the session from the authenticator class?
thumbnail
Mika Koivisto, geändert vor 11 Jahren.

RE: Get request in Authenticator hook

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
Well you could try PortalSessionThreadLocal.getHttpSession()
Carlos Lopez, geändert vor 10 Jahren.

RE: Get request in Authenticator hook

New Member Beitrag: 1 Beitrittsdatum: 15.11.13 Neueste Beiträge
This has helped me. Thanks.
thumbnail
ALex joubert, geändert vor 10 Jahren.

RE: Get request in Authenticator hook

Junior Member Beiträge: 27 Beitrittsdatum: 19.03.10 Neueste Beiträge
HI

How Can I Use : SessionErrors.add (request, "Exception");

I can not retrieve request in a class that inherits from Authenticator

I want to display a custom message with "liferay-ui:error"