Overview
S4Kit supports multiple authentication methods for connecting to SAP systems. Authentication is configured at the instance or service level.Authentication Types
Basic Authentication
Username and password authentication:- SAP GUI users with RFC access
- Technical users
- Simple integrations
OAuth 2.0 (Client Credentials)
OAuth authentication using client credentials flow:- S/4HANA Cloud
- SAP BTP services
- Modern integrations
API Key Header
Custom API key in a header:- Custom authentication gateways
- Third-party API proxies
Custom Headers
Any custom headers:- Complex authentication schemes
- Multi-header requirements
No Authentication
For public APIs:Configuration Levels
Authentication can be configured at multiple levels:Inheritance Chain
The platform uses the most specific configuration:- Instance Service Auth: For a specific service on a specific instance
- System Service Auth: For a service across all instances
- Instance Default Auth: Fallback for the instance
Example Scenario
Configuring Authentication
Via Dashboard
- Navigate to Instances or Services
- Click Configure Authentication
- Select authentication type
- Enter credentials
- Click Save
Testing Configuration
After configuring:- Click Test Connection
- Verify the connection succeeds
- Check the error message if it fails
OAuth 2.0 Configuration
S/4HANA Cloud Setup
- In SAP, create a Communication Arrangement
-
Note the OAuth details:
- Token URL
- Client ID
- Client Secret
- Scopes
- Configure in S4Kit:
Token Caching
S4Kit automatically:- Caches OAuth tokens
- Refreshes before expiration
- Handles token renewal
Basic Auth Configuration
SAP User Setup
- Create a technical user in SAP
-
Assign required authorizations:
- OData service access
- Business object authorizations
- Configure in S4Kit:
SAP Client
For multi-client systems:Security
Credential Storage
All credentials are encrypted using libsodium:- Encryption key is separate from data
- Credentials cannot be retrieved after saving
- Only “update” or “remove” operations available
Credential Visibility
In the dashboard, sensitive values show:Audit Trail
All authentication changes are logged:- Who made the change
- When it was made
- What was modified
Troubleshooting
401 Unauthorized
Possible causes:- Invalid credentials
- User account locked
- Missing authorizations
- Verify credentials in SAP
- Check user is not locked
- Verify OData service authorization
403 Forbidden
Possible causes:- Missing business authorizations
- IP restrictions
- License issues
- Check user’s SAP authorizations
- Verify IP allowlist if applicable
- Contact SAP basis team
OAuth Token Errors
Common issues:- Invalid client credentials
- Wrong token URL
- Missing scopes
- Regenerate client credentials
- Verify token URL matches SAP
- Add required scopes
Connection Timeout
Possible causes:- Network connectivity
- Firewall blocking
- SAP system down
- Verify network path to SAP
- Check firewall rules
- Confirm SAP system is running