Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:46:42+00:00 2026-05-15T23:46:42+00:00

I’m using Apache Geronimo as my application server. And authentication is happening over LDAP

  • 0

I’m using Apache Geronimo as my application server. And authentication is happening over LDAP using Apache Directory Service. I don’t have any previous experience with JavaEE software development, so please take it easy on me. Let me know if I need to explain anything in more detail.

Basically my login step is pretty similar to this example from the geronimo documentation:
https://cwiki.apache.org/GMOxDOC22/ldap-sample-app-ldap-sample-application.html

There are three different behaviors that are happening when a user is trying to login:

  1. When a user logs in with the correct username, which is in the correct ldap group, they are taken to a secure area of the site. And I’m not sure how to log the user out of the site until their session ends.

  2. When a user logs in with a username/password that isn’t in the LDAP directory, the user is redirected to /auth/logonError.html?param=test (this location is specified in in ‘web.xml’)

  3. When a user logs in with a correct username/password that is not in the appropriate group, they are redirected to a “HTTP 403 forbidden page”. There is an example of this page at the bottom of the ldap sample. The behavior should be the same as an unauthenticated user.

In all of these cases, there is no way for the user to retry the login process until the browser is restarted or a different browser is used. This is the big problem that I am having.

I would like the following scenarios to happen.

  1. A properly authenticated user can logout, and try to login again.

  2. A improperly authenticated user is redirected to the login screen, and told to try again.

What do I need to do to make this happen? Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:46:42+00:00Added an answer on May 15, 2026 at 11:46 pm

    Doesn’t this always happen. You run into a problem, struggle with it for a few days, finally post it to StackOverflow( or wherever ), and then you solve the problem relatively easily.

    I made some changes to my application that fixed the problem. I’m posting what I did in case anyone stumbles across this from google with a similar problem.

    First I created a servlet( called EndSessionServlet) that just did this:

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        endSession(request, response);
    }
    
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        endSession(request, response);
    }
    
    private void endSession(HttpServletRequest request, HttpServletResponse response) throws IOException{
        request.getSession().invalidate();
        response.sendRedirect(".");
    }
    

    And then I added this to my web.xml file:

    <error-page>
     <error-code>403</error-code>
     <location>/EndSessionServlet</location>
    </error-page>
    

    And I also changed the form-error-page in web.xml:

    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>This is not used for FORM login</realm-name>
    <form-login-config>
      <form-login-page>/login.jsp</form-login-page>
      <form-error-page>/EndSessionServlet</form-error-page>
    </form-login-config>
    </login-config>
    

    And I added a link in the section of the webpage that is authenticated to the EndSessionServlet. So the authenticated user can now logout properly.

    For the three scenarios:

    1. User is able to properly login, the user clicks the link to EndSessionServlet to logout
    2. The User enters a valid username/password for ldap, but is not in the correct group. This user is sent to the 403 page normally, which now invalidates the session, and redirects to the logon page.
    3. The user enters an invalid username/password and is sent to , which is also set to EndSessionServlet. This ends the session, and redirects them to the login page.

    So all of the scenarios work fine now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 469k
  • Answers 469k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's easy to do with a sort: sorted(mydict.iteritems(), key=lambda tup:… May 16, 2026 at 2:44 am
  • Editorial Team
    Editorial Team added an answer jQuery example $(function() { $('#yourCheckoxId').toggle(function() { $('a').attr('target', '_blank'); }, function()… May 16, 2026 at 2:44 am
  • Editorial Team
    Editorial Team added an answer You can always write your own comparator function and define… May 16, 2026 at 2:44 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.