This servlet will be invoked from the LifeRay screen, after the successful user log-in. The problem is that, in my servlet I need to get handle to the current logged-in LifeRay user. I am getting null value, when trying to get the current LifeRay userid through Request. Any help will be greatly appreciated.
Minhchau Dang, modified 10 Years ago. RE: request. After authentication in login controller subject. User belongs to Administrator group. All my deployment descriptors are set up well. Any idea where I am getting mistake? Creating and configuring custom JAAS login module solves problem.
See Listing 4 here. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 3 months ago. Active 9 years ago. Right after I get authenticated, if I call request. Please provide me the solution. Thanks in advace!!! It seems that the request. A JAAS login in a filter does not affect the request getUserPrincipal value as this is only set in the web container has authenticated the caller and this occurs before the filter is called.
The only way getUserPrincipal returns non-null is when secured content is being accessed. The security filter gets the username and the password from the callbackhandler and passes to the loginContext. Right after that, in the same filter, if I call request.
This method is useful for creating redirect messages and for reporting errors. If create is false and the request has no valid HttpSession , this method returns null. To make sure the session is properly maintained, you must call this method before the response is committed. If the container is using cookies to maintain session integrity and is asked to create a new session when the response is committed, an IllegalStateException is thrown. Parameters: create - true to create a new session for this request if necessary; false to return null if there's no current session Returns: the HttpSession associated with this request or null if create is false and the request has no valid session See Also: getSession getSession HttpSession getSession Returns the current session associated with this request, or if the request does not have a session, creates one.
If the client did not specify any session ID, this method returns false. IOException, ServletException Use the container login mechanism configured for the ServletContext to authenticate the user making this request.
This method may modify and commit the argument HttpServletResponse. Return false if authentication is incomplete and the underlying login mechanism has committed, in the response, the message e.
Throws: java. IOException - if an input or output error occurred while reading from this request or writing to the given response IllegalStateException - if the login mechanism attempted to modify the response and it was already committed ServletException - if the authentication failed and the caller is responsible for handling the error i. String password throws ServletException Validate the provided username and password in the password validation realm used by the web container login mechanism configured for the ServletContext.
This method returns without throwing a ServletException when the login mechanism configured for the ServletContext supports username password validation, and when, at the time of the call to login, the identity of the caller of the request had not been established i.
Otherwise, this method throws a ServletException as described below. When this method returns without throwing an exception, it must have established non-null values as the values returned by getUserPrincipal , getRemoteUser , and getAuthType. Parameters: username - The String value corresponding to the login identifier of the user. Throws: ServletException - if the configured login mechanism does not support username password authentication, or if a non-null caller identity had already been established prior to the call to login , or if validation of the provided username and password fails.
Since: Servlet 3. Throws: ServletException - if logout fails Since: Servlet 3. Any changes to the returned Collection must not affect this HttpServletRequest. Returns: a possibly empty Collection of the Part components of this request Throws: java. String name throws java. All Rights Reserved. Use is subject to license terms. Generated on February Scripting on this page tracks web page traffic, but does not change the content in any way.
Cookie [].
0コメント