This page contains instructions for setting up the OAuth 2.0 server in SAP and setting up the OAuth 2.0 client in Foundry.
SYSTEM user/PALANTIR/OAUTH_CLIENT should be assigned to the Foundry technical user and any end users wishing to write back to SAP from Foundry/PALANTIR/CONTENT_FUNCTION_ALL should be assigned to end user/sap/public/bc  node to be activated (for OAuth 2.0 configuration)
/sap/bc/sec/oauth2*/default_host/sap/bc/webdynpro/sap/oauth2_authoritySOAUTH2 transaction.https://<FOUNDRY_DOMAIN>/workspace/oauth2-clients/callback./PALANTIR/SRV_0001 and a description such as Palantir Foundry writeback using SAP functions.~CHECK_CSRF_TOKEN and value 0 (zero)./IWFND/MAINT_SERVICE transaction./PALANTIR/SRV_0001LOCAL/PALANTIR/SRVODATA_SRV1This follows the general approach outlined in Configure outbound applications but has been tailored specifically to SAP systems.
Ensure that the SAP source URL is using HTTPS, or webhooks will fail when using an OAuth flow.


On the overview page of the new REST API source, select Create webhook.
Give the webhook a name (such as “SAP OAuth2 authorization code flow webhook”).
Advance to the Request configuration step.
Under Calls, select POST as the request type and enter sap/bc/sec/oauth2/token as the path.
Under Query Params, sap-client might have to be set if the client used is not the default client.

redirect_uriclient_idauthorization_code
grant_type → authorization_coderedirect_uri → Mapped to the redirect_uri input parameter (see below for how to do this)client_id → Mapped to the client_id input parametercode → Mapped to the authorization_code input parameter

access_tokentoken_typeexpires_inrefresh_tokenscopeThis is an example for creating access_token. All output parameters should follow this pattern.

sap/bc/sec/oauth2/token ) should be used.sap-client as a Query Param if needed.Content-Type → application/x-www-form-urlencoded
client_idrefresh_tokengrant_type → refresh_tokenclient_id → Mapped to the client_id input parameterrefresh_token → Mapped to the refresh_token input parameter

access_tokentoken_typeexpires_inrefresh_tokenscopehttps://<SAP_DOMAIN>/sap/bc/sec/oauth2/authorize
/PALANTIR/SRV_0001.