ITSM-NG supports multiple authentication methods to integrate with your existing identity infrastructure. Each user can authenticate using one of several methods, and multiple methods can be active simultaneously.
// From inc/auth.class.php:74-82class Auth extends CommonGLPI { public const DB_GLPI = 1; // Local database public const MAIL = 2; // Mail server (IMAP/POP) public const LDAP = 3; // LDAP directory public const EXTERNAL = 4; // External SSO public const CAS = 5; // CAS server public const X509 = 6; // X.509 certificates public const API = 7; // API token public const COOKIE = 8; // Remember me cookie}
// From inc/auth.class.php:352-356public static function getPasswordHash($pass) { return password_hash($pass, PASSWORD_DEFAULT);}// Modern bcrypt/argon2 hashing with automatic salt
// From inc/auth.class.php:377-434$password_expiration_delay // Days until password expires$password_expiration_lock_delay // Additional days before account locks// Automatic account disable on expiration + lock delayif ($lock_date < current_time) { $user->update(['is_active' => 0]);}
// From inc/authldap.class.php:787-820'group_field' // User attribute with group membership'group_condition' // LDAP filter for groups'group_search_type' // Search in users, groups, or both'group_member_field' // Group attribute listing members'use_dn' // Use Distinguished Names in search
Search Types:
public const GROUP_SEARCH_USER = 0; // Search in user objectspublic const GROUP_SEARCH_GROUP = 1; // Search in group objects public const GROUP_SEARCH_BOTH = 2; // Search both
Name: Company Active DirectoryServer: ad.company.comPort: 389Base DN: DC=company,DC=comConnection Filter: (&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))Login Field: samaccountnameSync Field: objectguidUse TLS: YesUser Mapping: Surname: sn First Name: givenname Email: mail Phone: telephonenumber Mobile: mobile Title: title
// From inc/oidc.class.php:124-1461. User clicks "Login with SSO"2. Redirect to OIDC provider3. User authenticates at provider4. Provider redirects back with authorization code5. Exchange code for tokens6. Request user info from provider7. Create or link user account8. Establish session
// From inc/oidc.class.php:158-170// Custom field mapping via glpi_oidc_mapping table$mapping = [ 'name' => 'preferred_username', // Username field from OIDC 'email' => 'email', 'firstname' => 'given_name', 'realname' => 'family_name'];// Default to standard OIDC claims:'name' or 'sub' // Username'email' // Email address'given_name' // First name'family_name' // Last name
// From inc/oidc.class.php:171-200// If user doesn't exist:if ($newUser && $auth_username) { $user->add([ 'name' => $auth_username, '_extauth' => 1, // Mark as external auth ]);}// Link existing users if:// 1. sso_link_users is enabled, OR// 2. User's authtype is already EXTERNAL
// From inc/oidc.class.php:91-122// Preserve requested page through login:1. Store requested URL in cookie before redirect2. After authentication, redirect to original page3. Cookie expires after 5 minutes for security
// CAS configuration (global settings)'cas_host' // CAS server hostname'cas_port' // CAS server port'cas_uri' // CAS URI path'cas_version' // CAS protocol version (1.0, 2.0, 3.0)
// From inc/auth.class.php:575-624'x509_email_field' // Certificate field for email (CN, Email, etc.)'x509_ou_restrict' // Restrict by Organizational Unit'x509_o_restrict' // Restrict by Organization'x509_cn_restrict' // Restrict by Common Name// Certificate subject parsing:// CN=john.doe/OU=IT/O=Company/C=US/[email protected]
# From apirest.md:100-117# With user token:curl -X GET \ -H "Authorization: user_token q56hqkniwot8wntb3z1qarka5atf365taaa2uyjrn" \ 'http://glpi/apirest.php/initSession'# With login/password:curl -X GET \ -H "Authorization: Basic base64(login:password)" \ 'http://glpi/apirest.php/initSession'
// From inc/auth.class.php:769-9541. Check for alternate auth (OIDC, CAS, External SSO) → If configured, auto-redirect2. Try local database if: → No login_auth specified, OR → login_auth = 'local'3. Try LDAP if: → LDAP enabled AND → Not authenticated yet4. Try Mail if: → Mail auth enabled AND → Not authenticated yet