SAP Knowledge Base Article - Public

2665307 - ERROR: "Unable to validate \"api_key\" in the SAML assertion" while generating an OAuth Token using POSTMAN

Symptom

While requesting an OAuth Token using the SAML Assertion via POSTMAN, the below error comes:

{
"errorHttpCode": "401",
"errorMessage": "Unable to validate \"api_key\" in the SAML assertion"
}

Environment

SuccessFactors

Reproducing the Issue

Open a new window in Postman and enter the following details:

POST.PNG

  • Request Payload
    • Formulate the payload as such-
      • company_id - SuccessFactors Company ID
      • client_id - this is the API key that is available under Manage OAuth2 Client Applications

API Key.PNG

  • The response consists of below error

{
"errorHttpCode": "401",
"errorMessage": "Unable to validate \"api_key\" in the SAML assertion"
}

Cause

The API Key which is used for generating the SAML Assertion file through the URL  https://apisalesdemo4.successfactors.com/oauth/idp  and passed in the value for "client_id" in the request payload is incorrect

Resolution

  • Login to Successfactors Instance > navigate to Manage OAuth2 Client Application > select your Client Application > Note Down the API Key present there

API Key.PNG

  • Generate the SAML Assertion file using the POST URL https://apisalesdemo4.successfactors.com/oauth/idp
  • Please make sure that the request payload of the POST operation should have the value for client_id same as the API Key noted in the previous step

KeySame.PNG

See Also

Blog: How to initiate an OAuth connection to SuccessFactors Employee Central?

Keywords

Manage OAuth2 Client Applications, "Unable to validate \"api_key\" in the SAML assertion", OAuth Token, SAML Assertion File , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , Problem

Product

SAP SuccessFactors HCM Core 1805