All iDempiere web service requests require authentication using the ADLoginRequest structure. The system validates credentials, role access, and establishes a session context for subsequent operations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/idempiere/idempiere/llms.txt
Use this file to discover all available pages before exploring further.
Authentication Flow
Login Request Structure
Every web service request includes an ADLoginRequest element containing authentication and context information.ADLoginRequest Parameters
Username or email address. The system configuration determines whether to use username or email for login (controlled by
USE_EMAIL_FOR_LOGIN system configuration).User password in plain text. The password is validated against the AD_User table.
Language and locale code for the session. Affects date formats, decimal separators, and translated messages.Common values:
en_US- English (United States)es_MX- Spanish (Mexico)de_DE- German (Germany)fr_FR- French (France)zh_CN- Chinese (China)
The tenant/client ID (AD_Client_ID). System client is 0, but web services typically use a specific tenant.The user must have access to this client.
The role ID (AD_Role_ID) to use for this session. The role must:
- Be assigned to the user
- Have RoleType of NULL or ‘WS’ (web service enabled)
- Have access to the specified organization
- Have access to the requested web service type
The organization ID (AD_Org_ID) for the session context. The role must have access to this organization through:
IsAccessAllOrgs = 'Y', or- AD_Role_OrgAccess entries, or
- AD_User_OrgAccess entries (if
IsUseUserOrgAccess = 'Y')
The warehouse ID (M_Warehouse_ID) for the session. Can be 0 if no warehouse is required. The warehouse must belong to an organization accessible by the role.
Session expiry time in minutes. Common values:
9- Standard session (recommended)0- Session expires immediately after request (not cached)60- 1 hour session480- 8 hour session
Authentication Examples
Session Management
Session Caching
iDempiere caches authenticated sessions to improve performance and reduce database load. Sessions are cached using a composite key:If any parameter changes (including IP address), a new session is created. This ensures security while allowing session reuse for repeated requests.
Session Expiry
Sessions expire based on thestage parameter (expiry time in minutes):
- Active Sessions: Refreshed on each successful authorization
- Expired Sessions: Automatically removed when
connectCount == 0and expiry time elapsed - Session Cleanup: Sessions are logged out and removed from cache when expired
Context Variables
Authenticated sessions establish the following context variables:Current client/tenant ID
Current organization ID
Current user ID
Current user name
Current role ID
Current warehouse ID
Sales representative ID (same as user ID)
Session language code
Current date for the session
Role Configuration
Web Service Enabled Roles
For a role to access web services, it must meet these requirements:- Role Type: Must be NULL or ‘WS’ in the AD_Role table
- Active: Role must be active
- User Assignment: Role must be assigned to the user
- Organization Access: Role must have access to the specified organization
Web Service Type Access
Access to specific web service operations is controlled throughWS_WebServiceTypeAccess:
- Direct role access
- Included role access (role inheritance)
- Active status of the access record
Validation Hooks
iDempiere provides extension points for custom authentication logic through theIWSValidator interface.
Validation Timing
Before Login
TIMING_BEFORE_LOGIN - Validate credentials before authenticationUse cases:- IP whitelist validation
- Rate limiting
- Custom password policies
After Login
TIMING_AFTER_LOGIN - Validate after successful authenticationUse cases:- Audit logging
- External system integration
- License validation
Custom Validator Example
Common Authentication Errors
Error: User invalid
Error: User invalid
Cause: Username/password combination is incorrect.Solution:
- Verify credentials in the AD_User table
- Check if email login is enabled (USE_EMAIL_FOR_LOGIN)
- Ensure user is active
Error: Tenant not allowed for this user
Error: Tenant not allowed for this user
Cause: User doesn’t have access to the specified ClientID.Solution:
- Verify user has a role in the specified client
- Check AD_User_Roles table
Error: Role not allowed for this user
Error: Role not allowed for this user
Cause: Specified RoleID is not assigned to the user or not web service enabled.Solution:
- Check AD_User_Roles for role assignment
- Verify role has RoleType NULL or ‘WS’
- Ensure role is active
Error: Org not allowed for this role
Error: Org not allowed for this role
Cause: Role doesn’t have access to the specified OrgID.Solution:
- Check AD_Role_OrgAccess table
- Verify IsAccessAllOrgs setting on role
- If using user org access, check AD_User_OrgAccess
Error: Warehouse not allowed for this org
Error: Warehouse not allowed for this org
Cause: Warehouse doesn’t belong to an accessible organization.Solution:
- Verify warehouse exists (M_Warehouse)
- Check warehouse organization
- Try WarehouseID = 0 if no warehouse needed
Error: Login role does not have access to the service type
Error: Login role does not have access to the service type
Cause: Role lacks permission for the specific web service type.Solution:
- Add entry in WS_WebServiceTypeAccess
- Verify service type is active
- Check included roles if using role inheritance
Security Best Practices
Use HTTPS
Always use TLS/SSL encryption for web service communications to protect credentials and data in transit.
Dedicated Service Users
Create dedicated user accounts for web service integration rather than using personal accounts.
Least Privilege Roles
Assign roles with minimal required permissions. Create specific web service roles with restricted access.
Session Expiry
Use appropriate session expiry times. Shorter times for sensitive operations, longer for batch processing.
IP Whitelisting
Implement IP-based access control using custom validators or network-level restrictions.
Audit Logging
Implement custom validators to log all web service access for security auditing.
Testing Authentication
Test your authentication configuration:Verify User Access
Log in to iDempiere UI with the web service user credentials to ensure the account works.
Check Role Configuration
Navigate to Role window and verify:
- Role Type is NULL or WS
- User is assigned to the role
- Organization access is configured
Configure Service Type Access
In Web Service Type Access window, create entries for:
- Role ID
- Web Service Type
- IsActive = Y