Authentication
Squid leverages ServiceNow's native authentication mechanisms rather than implementing its own. This ensures consistency with your existing ServiceNow security posture and eliminates the need to manage separate credentials.
How Authentication Works
ServiceNow Session Authentication
All Squid API requests are authenticated through ServiceNow's standard session management:
Supported Authentication Methods
Squid supports all authentication methods that ServiceNow supports, including:
- Basic Authentication - Username and password
- OAuth 2.0 - Token-based authentication
- LDAP/SSO - Federated identity
- Mutual TLS - Certificate-based authentication
The authentication method is transparent to Squid - it only sees the authenticated ServiceNow session.
The rest Role Requirement
Every API request to Squid requires the authenticated user to possess the x_a46gh_squidx.rest role. This is the first security checkpoint.
Strictly speaking, role checks are authorization (what can you do?) rather than authentication (who are you?). We document the rest role here because it answers a practical question: "Can I use Squid at all?" The ServiceNow session plus the rest role together form the entry gate. Once past this gate, Authorization covers what specific data you can access.
Why a Dedicated API Role?
The rest role serves several purposes:
- Explicit Opt-In - Users don't accidentally get API access
- Separation of Concerns - API access is distinct from UI access
- Audit Trail - Easy to identify who has API access
- Principle of Least Privilege - Only grant API access where needed
Authentication Errors
When authentication fails, Squid returns appropriate HTTP status codes:
| Status Code | Meaning |
|---|---|
| 401 Unauthorized | No valid ServiceNow session |
| 403 Forbidden | Session valid but lacks rest role |
Service Account Best Practices
For production integrations, use dedicated service accounts rather than personal user accounts:
Creating a Service Account
- Create a new user in ServiceNow (e.g.,
squid_integration_accounting) - Assign the
x_a46gh_squidx.restrole - Assign configuration-specific roles as needed (e.g.,
x_a46gh_squidx.defaultAccess) - Do NOT assign the
adminrole
Service Account Naming Conventions
Adopt a consistent naming convention to identify service accounts:
squid_{purpose}_{system}
Examples:
- squid_cmdb_export_servicenow
- squid_asset_sync_sccm
- squid_ci_data_monitoring
Single-Use Instance Protection
Squid implements a safeguard against request reuse attacks. Each Squid instance is single-use, preventing potential state leakage between requests.
Network Security Considerations
While Squid relies on ServiceNow for authentication, consider these network-level security measures:
TLS/HTTPS
All communication with ServiceNow (and therefore Squid) should use HTTPS. ServiceNow enforces this by default.
IP Allowlisting
Consider restricting API access to known IP addresses using ServiceNow's IP access control features.
VPN/Private Connectivity
For highly sensitive data, consider using ServiceNow's VPN connector or private service connect options.
Related Topics
- Authorization - What authenticated users can access
- Best Practices - Service account recommendations
- Auditing - Tracking authentication events