Foros de discusión

Get request in Authenticator hook

thumbnail
Ken Driscoll, modificado hace 11 años.

Get request in Authenticator hook

Junior Member Mensajes: 57 Fecha de incorporación: 2/07/12 Mensajes recientes
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, modificado hace 11 años.

RE: Get request in Authenticator hook

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
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, modificado hace 11 años.

RE: Get request in Authenticator hook

Junior Member Mensajes: 57 Fecha de incorporación: 2/07/12 Mensajes recientes
That's what I was afraid of. Is there any way to access the session from the authenticator class?
thumbnail
Mika Koivisto, modificado hace 11 años.

RE: Get request in Authenticator hook

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
Well you could try PortalSessionThreadLocal.getHttpSession()
Carlos Lopez, modificado hace 10 años.

RE: Get request in Authenticator hook

New Member Mensaje: 1 Fecha de incorporación: 15/11/13 Mensajes recientes
This has helped me. Thanks.
thumbnail
ALex joubert, modificado hace 10 años.

RE: Get request in Authenticator hook

Junior Member Mensajes: 27 Fecha de incorporación: 19/03/10 Mensajes recientes
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"