Overview
S4Kit uses an inheritance model for authentication, allowing you to configure credentials at different levels. The most specific configuration always wins.Inheritance Chain
Configuration Levels
Instance Default
The base authentication for an instance:System Service
Override for a specific service across all instances:Instance Service
Override for a specific service on a specific instance:Resolution Example
Consider this configuration:Resolution Results
| Instance | Service | Auth Used | Reason |
|---|---|---|---|
| production | API_BUSINESS_PARTNER | OAuth (BP_PROD) | Instance Service override |
| production | API_SALES_ORDER | OAuth (SALES_GLOBAL) | System Service override |
| production | API_PRODUCT | Basic (PROD_USER) | Instance Default |
| dev | API_BUSINESS_PARTNER | Basic (DEV_USER) | Instance Default |
| dev | API_SALES_ORDER | OAuth (SALES_GLOBAL) | System Service override |
| dev | API_PRODUCT | Basic (DEV_USER) | Instance Default |
Use Cases
Different Users per Environment
OAuth for Sensitive Services
Third-Party Integration Service
Best Practices
Start Simple
Begin with instance defaults:Use OAuth When Available
OAuth provides:- Automatic token refresh
- Better security (no password transmission)
- Granular scopes
Separate by Security Level
Document Your Configuration
Keep a record of:- Which services use which auth
- Why overrides exist
- Credential owners
Troubleshooting
Wrong Credentials Used
Symptom: Request uses unexpected authentication Solution: Check inheritance chain- Is there an Instance Service config?
- Is there a System Service config?
- What is the Instance Default?
OAuth Token Issues
Symptom: Token refresh fails for some services Solution: Verify OAuth config at correct level- Check token URL is correct
- Verify scopes are appropriate
- Ensure client has access to service
Authentication Mismatch
Symptom: 401 errors after configuration change Solution: Check for shadowing- Service-level config may override your change
- Clear Redis cache after changes
- Test with explicit service parameter
Viewing Effective Auth
In the dashboard, view the effective authentication:- Go to Instances → Select instance
- Click Services
- Each service shows its effective auth source:
- “Instance Service” - service-specific override
- “System Service” - system-wide service config
- “Instance Default” - fallback to instance auth