Authentication & Connectivity
OAuth, Basic Auth, SAP Cloud Connector und Zertifikatsverwaltung.
1. Pull-Modell (Bilendo → SAP)
1.1 S/4HANA Cloud: OAuth 2.0 Client Credentials
Konfiguration in SAP:
Communication Arrangement (BTP)
Communication User anlegen
Token URL bereitstellen
HTTP-Anfrage:
POST /oauth/token HTTP/1.1
Host: <sap-cloud-instance>.authentication.<region>.hana.ondemand.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=<CLIENT_ID>
&client_secret=<CLIENT_SECRET>Antwort:
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}Nachfolgende OData-Anfrage:
GET /sap/opu/odata/sap/C_SALESDOCUMENT_CDS HTTP/1.1
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...Sequence Diagram:
sequenceDiagram
participant Bilendo as Bilendo<br/>(Client)
participant TokenSrv as SAP Token<br/>Service
participant SAP as SAP S/4HANA<br/>Cloud
Bilendo->>TokenSrv: POST /oauth/token<br/>(client_id, client_secret)
TokenSrv-->>Bilendo: access_token (Bearer)
Bilendo->>SAP: GET /odata/...<br/>Authorization: Bearer token
SAP-->>Bilendo: OData Response (JSON)1.2 S/4HANA On-Premise: Basic Auth oder X.509
Basic Authentication:
SAP-Seite (SU01):
Technischen Benutzer anlegen (z.B.
BILENDO_INT)Passwort setzen (min. 8 Zeichen, komplexes Passwort)
Berechtigungsgruppe zuweisen
Gateway aktivieren (SICF):
Transaction SICF
Service
/sap/opu/odata/sap/<Service>aktivierenAuthentifizierung:
Basic Auth
Test-Befehl (cURL):
curl -X GET \
-H "Authorization: Basic $(echo -n 'BILENDO_INT:Passwort123!' | base64)" \
-H "Content-Type: application/json" \
"https://sap-on-premise.example.com:50000/sap/opu/odata/sap/C_SALESDOCUMENT_CDS?$top=10"X.509 Zertifikat-Auth (höherer Sicherheitsstandard):
Client-Zertifikat von PKI-Stelle beziehen
In SAP System Certificate Management (STRUST) importieren
cURL mit
--certParameter:
curl -X GET \
--cert /path/to/client.crt --key /path/to/client.key \
"https://sap-on-premise.example.com:50000/sap/opu/odata/sap/C_SALESDOCUMENT_CDS"1.3 ECC + Gateway: Basic Auth
Architektur:
ECC-System ohne direktes OData Support
Separater SAP API Management Gateway (optional) oder Netweaver Gateway (GW100)
Konfiguration:
RFC-Benutzer in ECC (SU01):
Typ: System (System User)
Dialog-Anmeldung: deaktiviert
Automatische Anmeldung: nicht zulässig
Gateway Service (SICF):
Service
/sap/opu/odata/sap/<ODataService>registrierenRFC-Destination auf ECC System setzen
SSL: Protokoll HTTPS erzwingen
IP-Whitelist (optional aber empfohlen):
Transaction SICF → Service Properties → Access Control
Allowed IP ranges: 192.168.1.0/24, 10.0.0.0/8Test (Basic Auth):
curl -u "RFC_USER:password" \
"https://gateway.example.com:50000/sap/opu/odata/sap/Z_CUSTOMER_SRV/Customers"2. Push-Modell (SAP → Bilendo)
2.1 Bilendo REST API: API Key oder OAuth2
API Key-Authentifizierung (einfach):
POST https://api.bilendo.de/v2/documents HTTP/1.1
Authorization: ApiKey <API_KEY>
Content-Type: application/json
{
"document_type": "SALES_ORDER",
"external_id": "4500123456",
"amount": 5499.99
}OAuth2 Authorization Code Flow (sicher):
SAP leitet Benutzer auf Bilendo Authorization Endpoint
Benutzer bestätigt Zugriff
SAP erhält Authorization Code
SAP tauscht Code gegen Access Token
POST https://api.bilendo.de/oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code=<AUTHORIZATION_CODE>
&client_id=<SAP_CLIENT_ID>
&client_secret=<SAP_CLIENT_SECRET>
&redirect_uri=https://sap-system/callback2.2 SAP CPI: HTTP Destination & Credential Store
Konfiguration in SAP Cloud Integration:
HTTP Destination (BTP):
URL:
https://api.bilendo.deAuthentication Type:
OAuth2Token Service URL:
https://api.bilendo.de/oauth/tokenClient ID / Secret aus Credential Store
Credential Store (Cloud Connector / BTP):
Key: bilendo_oauth_credentials Value: {"client_id": "...", "client_secret": "..."}iFlow Integration:
HTTP Target Adapter mit Destination
Bilendo_OData_PushMessage Type: JSON
POST zu
/v2/documentsEndpointMapping: SAP Geschäftsdokument → Bilendo Format
Error Handling:
Retry mit exponential backoff (3x)
Dead Letter Queue bei persistenten Fehlern
Audit Log für alle Transaktionen
3. Netzwerk-Konnektivität
Topologie für S/4HANA Cloud & On-Premise
graph TB
subgraph Bilendo["Bilendo (SaaS)"]
BE["REST API<br/>OData Consumer"]
end
subgraph AWS["AWS / Azure"]
LB["Load Balancer"]
API["API Gateway"]
end
subgraph SAP_Cloud["SAP S/4HANA Cloud<br/>(BTP)"]
S4C["OData Services"]
end
subgraph Kundennetz["Customer Network"]
RP["Reverse Proxy<br/>(Optional)"]
FW["Firewall"]
ECC["SAP System<br/>(On-Prem/ECC)"]
end
BE -->|HTTPS| LB
API -->|Direct HTTPS| S4C
API -->|Cloud Connector| S4C
BE -->|HTTPS| RP
RP -->|HTTP| FW
FW -->|RFC| ECCConnectivity-Optionen
| Option | Komplexität | Voraussetzung | Sicherheit | Latenz | Firewall |
|---|---|---|---|---|---|
| S/4HANA Cloud: Direct HTTPS | Niedrig | BTP Tenant, OAuth2 | ⭐⭐⭐⭐⭐ | <100ms | Nur ausgehend |
| S/4HANA Cloud: Cloud Connector | Mittel | CC Installation, JVM | ⭐⭐⭐⭐⭐ | 100–200ms | Nur ausgehend |
| On-Prem: Reverse Proxy | Mittel | Apache/nginx, SSL | ⭐⭐⭐⭐ | <50ms | Eingehend, Whitelist |
| On-Prem: VPN | Hoch | VPN Appliance, Zertifikate | ⭐⭐⭐⭐⭐ | 50–150ms | Transparent |
| On-Prem: Cloud Connector | Hoch | CC + BTP Middleware | ⭐⭐⭐⭐⭐ | 100–300ms | Nur ausgehend |
Empfehlung:
Cloud-Umgebungen: Direct HTTPS (einfach, sicher)
On-Premise: Reverse Proxy mit IP-Whitelist (Balance aus Sicherheit & Komplexität)
Geschäftskritisch: VPN + Cloud Connector (höchste Sicherheit)
4. Berechtigungen
Erforderliche SAP Authorization Objects
| Objekt | Berechtigter Benutzer | Aktivität | Berechtigungswert |
|---|---|---|---|
| S_SERVICE | RFC/Technischer User | OData Service Zugriff | /sap/opu/odata/sap/C_* |
| F_BKPF_BUK | RFC/Technischer User | Dokumentenlesung (Finance) | Buchungskreis 0001 |
| F_KNA1_BUK | RFC/Technischer User | Kundenstamm-Lesung | Verkaufsorganisation 1000 |
| V_VBAK_VKO | RFC/Technischer User | Verkaufsorder-Lesung | Verkaufsorganisation 1000 |
| S_TABU_DIS | RFC/Technischer User | Tabellenzugriff | Aktivität 03 (Display) |
Minimalprinzip:
Nur erforderliche Berechtigungen zuweisen
Service-User keine Dialog-Anmeldung
Berechtigungen regelmäßig auditieren (Transaction SUIM)
5. Sicherheitsempfehlungen
Kryptographie & Transport
TLS-Version: Mindestens TLS 1.2 (empfohlen: TLS 1.3)
Cipher Suites: ECDHE oder RSA mit SHA-256 minimal
Zertifikate: Client-Zertifikate bevorzugt gegenüber API Keys
# Test TLS-Version:
openssl s_client -connect sap-system.example.com:50000 -tls1_2Authentifizierung
OAuth2 für Cloud-Szenarien (Standard)
Basic Auth nur mit TLS, nie über HTTP
X.509 Zertifikate für kritische Integration
API Keys: Rotation alle 90 Tage, niemals committen
Netzwerk & Zugriffskontrolle
IP-Whitelist: Restriktive SICF-Konfiguration
Firewall: Nur notwendige Ports (443, ggfs. 50000–50099 für SAP)
VPN: Für On-Premise Integration über öffentliches Netz
Audit & Monitoring
SM20 (Audit Log): OData-Zugriffe protokollieren
CL_HTTP_SERVER: HTTP-Header & Parameter loggen
SAP Alert Monitor: Ungewöhnliche Authentifizierungsfehler
Passwort-Policy
Länge: Mindestens 12 Zeichen
Komplexität: Großbuchstaben, Kleinbuchstaben, Ziffern, Sonderzeichen
Rotation: Alle 180 Tage für technische User
Speicherung: SAP Credential Store oder external Secret Manager (Azure Key Vault, AWS Secrets Manager)
Beispiel: Sichere Integration (Best Practice)
# Authentifizierung: OAuth2
POST https://sap-instance.authentication.eu10.hana.ondemand.com/oauth/token
client_id=ABC123
client_secret=<aus_credential_store>
# OData-Aufruf mit Bearer Token
GET https://sap-cloud.example.com/sap/opu/odata/sap/C_SALESDOCUMENT_CDS?$filter=CreatedOn%20gt%202026-04-01
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9...
X-Request-ID: bilendo-20260409-12345 # für TracingCheckliste vor Produktivgang
Authentifizierungsmethode ausgewählt (OAuth2/Basic/X.509)
SAP-Benutzer angelegt & getestet (SU01)
Gateway Service aktiviert & erreichbar (SICF)
Berechtigungen minimal & auditiert
Netzwerk-Konnektivität verifiziert (Proxy/VPN/Cloud Connector)
TLS 1.2+ erzwungen
API Keys / Credentials in Credential Store
Audit Log aktiv (SM20)
Monitoring & Alerting konfiguriert
Dokumentation aktuell
**