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

  • Home
  • SEARCH
  • 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 8720989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:08:55+00:00 2026-06-13T07:08:55+00:00

I have a simple webpage deployed to tomcat which runs certain shell scripts based

  • 0

I have a simple webpage deployed to tomcat which runs certain shell scripts based on user selection. The pages are written in html and cgi/perl.

We already have a working ldap server and directory. I need to be able to add security to the web page I created so a user is asked to login using their ldap account when trying to access the home page or any off the sub pages.

How do I add ldap authentication to my web page?

Please be very specific as I am new to all of this. Step by step instructions including code would be greatly appreciated. Thank You

I did a lot of research on google, but all of the solutions are generic, and I don’t know where to start.

This is a good article, but I’m not sure where do I put my connection to ldap and the binding (which of my pages)? How do I make sure the authentication will apply to the sub pages as well, or any other one created in the future?

http://www.perlmonks.org/?node_id=32196

Cheers

  • 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-06-13T07:08:56+00:00Added an answer on June 13, 2026 at 7:08 am

    This is a good article, but I’m not sure where do I put my connection
    to ldap and the binding (which of my pages)? How do I make sure the
    authentication will apply to the sub pages as well, or any other one
    created in the future?

    You’re now adding state to your app. You might initially think about implementing your authentication (authn) and authorization (authz) in tomcat, and not in your app.

    If you decide not to implement in tomcat, and choose to implement in perl, then you’ve just decided to add state to your application, which means you need to add some kind of session handling. Look at CGI::Session, there are many other session handling modules on CPAN. Avoid Apache::Session. Its lock handling can cause lots of pain if transactions run long. Use a session key in a cookie. Send everything over SSL. if you don’t use SSL, then crackers can intercept your session keys, and then hijack the sessions.

    Once you have your session infrastructure set up, you need to create a login mechanism, usually a form with username and password. when that form is submitted, the CGI behind it does its magic crypto on the password and then does the LDAP dance:

    1. connect to the directory server is no connection already exists.

    2a. bind to the server anonymously or as an application user, search for the user by CN, bind as the user using DN and password

    OR

    2b. compute the DN form the username, bind with the DN and the crypto’s password.

    Often, step 3 is to check the user’s record for some authorization indicator, it could be a yes/no access indicator, or it could be a list of roles or privileges.

    If the user is successfully authenticated, and authorized, then write some authorization info into the user’s session.

    Each subsequent page of your app will then check to see if the user is logged in and/or has the proper authz to use that page. If unauthorized, you can either send them back to the post-login landing page, or to the login page if they aren’t logged in.

    Basically, you just replacing the usual “query the user table of the database” with a query to an LDAP to a directory server.

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

Sidebar

Related Questions

I have a simple rails webpage where a user enters in a few textfields
I have a simple voting webpage, where user is presented with a table with
I have created a simple webpage with several images, but when a user visits
I have built a simple webpage as the frontend user interface for users to
I have made a simple webpage with a Javascript backend. I want the user
I have a simple Web Browser Control that displays a local webpage and that
I believe my question this time is simple. Let say I have a webpage,
I have made a simple web-page including a couple of static pages, a css
I have a simple jQuery code that runs on a web page that has
I have a simple webpage: <html> <body> When button has value of Start Clock

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.