Find your API host
The API host is the HTTPS host and port of your system’s OData endpoint.
Get the host from your Basis team
Use the host and port that serve /sap/opu/odata, for example s4.example.com:44300.
Activate the OAuth token service
The token endpoint is an ICF service that must be active.
Activate the service in SICF
In transaction SICF, activate default_host/sap/bc/sec/oauth2. Tokens are then issued at https://<host>/sap/bc/sec/oauth2/token.
Enable OAuth on the OData services
Each OData service you want to call must allow OAuth.
Enable OAuth per service
In /IWFND/MAINT_SERVICE, select each service and enable OAuth. This creates its OAuth scope.
API_BUSINESS_PARTNER(scopeAPI_BUSINESS_PARTNER_0001) for Business Partner, Customer and SupplierAPI_SALES_QUOTATION_SRV,API_SALES_CONTRACT_SRV,API_SLSPRICINGCONDITIONRECORD_SRVAPI_CUSTOMER_MATERIAL_SRV,API_MATERIAL_STOCK_SRV,API_MATERIAL_DOCUMENT_SRV,API_BILLING_DOCUMENT_SRV- If the service is registered under a different technical name (e.g.
ZAPI_...), its scope uses that name
Register the OAuth client
The OAuth client is tied to a technical user whose roles allow the APIs.
Create the client in SOAUTH2
In transaction SOAUTH2, create an OAuth 2.0 client for a technical (system) user.
- The Client ID is the technical user name; the Client Secret is that user’s password
- Enable the Client Credentials grant type
- Assign the scopes of every service you enabled, e.g.
API_BUSINESS_PARTNER_0001
Authorize the technical user
Calls run as the technical user, so give it roles (PFCG) that allow the APIs, including authorization object S_SCOPE for the OAuth client and its scopes.
Link the Account
Connect
- Click Connect.
- If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider’s authorization flow.
- Once authorization is successful, you will see a confirmation popup.
Use Actions