Symptom
- HTTP 401 Unauthorized is returned.
- Error message: code “42000”, group “iamservice.root”, message “Either the username or the password is incorrect. Please try again with valid sign-in credentials.”
Environment
SAP Sales and Service Cloud Version 2
Reproducing the Issue
- Create a technical user configured for OAuth 2.0 Client Credentials for inbound communication.
- Attempt to retrieve an access token using the client credentials.
- Observe that the request fails with an authentication error.
Cause
The OAuth 2.0 Client Credentials flow requires specific configuration steps before an access token can be successfully generated.
Resolution
-
Use the OAuth 2.0 token endpoint to request an access token
• Method: POST
• URL: https://tenantURL/oauth2/token -
Configure the Authorization
• Type: Inherit Auth -
Configure the request headers
• Authorization: Basic {Base64Encode(clientId:clientSecret)}
• Content-Type: application/x-www-form-urlencoded -
Configure the request body
• Body Type: x-www-form-urlencoded
• Parameter: grant_type=client_credentials -
Send the request
• If the configuration is correct, the system returns an OAuth 2.0 access token
Keywords
OAuth 2.0; OAuth2; Client Credentials; Client Credentials Flow; API User; API Client; Access Token; Token Endpoint; OAuth Token; Inbound Communication; Authentication; Authorization; Client ID; Client Secret; Base64 Encoding; Basic Authentication; POST Request; REST API; OData API; SAP Sales Cloud V2; SAP Service Cloud V2; SAP CX; API Authentication; Integration; System-to-System Integration; Bearer Token; HTTP Headers; Content-Type; grant_type=client_credentials; 401 Unauthorized , KBA , CEC-CRM-IAM , Identity and Access Management for SAP Sales/Service Cloud , How To
SAP Knowledge Base Article - Public