java ee - Geronimo webapp using ldap authentication -
I am using Apache Jeromeo as my application server. Authentication is being done on LDAP using the ADPE directory service. I have no previous experience with Java software development, so please make it easy for me. Tell me that I can explain anything in more detail.
Actually my login step is similar to this example from Geronimo's documentation:
Three different behaviors are happening when a user is trying to login:
-
When a user logs in with the correct username, which is in the correct ladder group, they are taken to a safe area of the site. And I'm not sure how to login a user from the site until the end of its session.
-
When a user logs in to the user name / password LDAP directory, user (specified in this location in 'web.xml') /auth/logonError.html ? Param = test will be sent to
-
A user's log with the appropriate username / password that is not in the appropriate group, "HTTP 403 denied page" The Ldap is an example of this page at the bottom of the sample. Behavior should be similar to an uncertain user.
In all these cases, there is no way the user can retry the login process unless the browser is restarted or used a different browser. It is a big problem that I am doing.
I should have the following scenario:
-
An appropriate authenticated user can logout, and try to log in again.
-
An improperly certified user has been redirected to the login screen, and asked to try again.
What do I need to do to do this? Thanks for your help.
It is not always the case that you participate in a problem, struggle for a few days Finally, you can post it over stack overflow (or anywhere), and then you solve the problem relatively easily.
I have made some changes to my application which can cause trouble. I'm posting. I did not do anything in this case with this kind of problem stumble across from Google
First of all I created a servlet (called EndSessionServlet) that just did this:.
Protects zero COGET (HTTPArlate Request Request, HTTPSvette Response Response) Servlet Upption, IOE EXPLORE {End Session (Request, Response) throws; } Secure zero doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {endSession (request, response); } Private zero end session (HttpServletRequest request, HttpServletResponse response) throws IOException {request.getSession (). Invalid (); Response.sendRedirect ("."); }
And then I put it on my web Added to the Xml file:
& lt; Error page & gt; & Lt; Error code & gt; 403 & lt; / Error code & gt; & Lt; Location & gt; / EndSessionServlet & lt; / Location & gt; & Lt; / Error page & gt;
And I also changed the form-error page in web.xml:
And I added a link to the section of the webpage that is authenticated for the end of the session. Then certified users can now correctly logout
for three scenarios:
- The user is able to log in to log in, the user clicks the link for EndSessionServlet
- in a valid user name / password for the user ldap Enters, but is not in the right group. This user is normally 403 pages, which is now sent to invalidate the session, and redirect to the logon page.
- The user enters the wrong user name / password and is sent to, which is also set to the EndSessionServlet. This session ends, and redirects them to the login page.
So all the scenarios work fine now.
Comments
Post a Comment