LDAP Authentication Class
LdapAuth.RdLDAP Authentication Class
LDAP Authentication Class
Public fields
- config
- LDAP configuration 
- authenticated
- Authentication status 
- user_info
- User information Initialize LDAP Authentication 
Methods
Method new()
Usage
LdapAuth$new(
  host,
  base_dn,
  port = 389,
  user_attr = "uid",
  domain = NULL,
  ssh_tunnel = NULL,
  db_ops = NULL,
  session_duration_days = 7,
  auth_table = "sjs_auth"
)Arguments
- host
- LDAP server hostname 
- base_dn
- Base Distinguished Name 
- port
- LDAP port (default: 389) 
- user_attr
- User attribute (default: "uid") 
- domain
- Domain for UPN binding (e.g., "pitt.edu") 
- ssh_tunnel
- Local port number for SSH tunnel (assumes tunnel already running, e.g., - ssh_tunnel = 3389)
- db_ops
- Database operations object for session management 
- session_duration_days
- Number of days sessions remain valid (default: 7) 
- auth_table
- Name of authentication sessions table (default: "sjs_auth") Ensure session table exists once during initialization (no read check) 
Method ensure_session_table_once()
Creates the authentication session table if it doesn't exist and performs initial cleanup Generate secure session token
Method generate_token()
Generates a 32-byte random hex token for session authentication Create new session
Method cleanup_expired_sessions_silent()
Removes expired sessions from the database without warning messages Clean up expired sessions
Method cleanup_expired_sessions()
Removes expired sessions from the database with error logging Remove specific session
Method get_connection_params()
Returns connection parameters, using SSH tunnel settings if configured Authenticate user credentials