LDAP Authentication Class
LdapAuth.RdLDAP Authentication Class
LDAP Authentication Class
Public fields
configLDAP configuration
authenticatedAuthentication status
user_infoUser 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
hostLDAP server hostname
base_dnBase Distinguished Name
portLDAP port (default: 389)
user_attrUser attribute (default: "uid")
domainDomain for UPN binding (e.g., "pitt.edu")
ssh_tunnelLocal port number for SSH tunnel (assumes tunnel already running, e.g.,
ssh_tunnel = 3389)db_opsDatabase operations object for session management
session_duration_daysNumber of days sessions remain valid (default: 7)
auth_tableName 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