SAP Knowledge Base Article - Public

2800150 - How to test OAuth authentication via Postman - SuccessFactors Integrations

Symptom

This document will provide the steps to test the OAuth authentication.

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

SuccessFactors BizX - all versions

Postman

Resolution

1. Admin Center->Manage OAuth2 Client Applications-> Register

2. Application name: Test Deepa; Application URL: https://localhost/
3. Generate X509 certificate

4. Common Name(CN): SF and then “Generate”

manageOAuthClient.png

5. Download the .pem file. It contains private key and certificate. (Can be seen in notepad++)

6. Save the configuration

SaveConfiguration.png

7. Now go back to Postman REST Client for SAML Assertion and create a new http POST call. Set the URL to your API URL. Set Authorization = 'no Auth', goto Body, select the media type as 'x-www-form-urlencoded' and then you can enter values in key-values format. Enter the values in it as follow :

client ID: OAuth Client ID: API Key generated (in this example YTJlZGJlMDUwYWMzYmViZDI2MGRhYWNiZDYxOA)

user_id = cgrant1

token_url = https://apisalesdemo4.successfactors.com/oauth/token

private_key = everything between -----BEGIN ENCRYPTED PRIVATE KEY----- and -----END ENCRYPTED PRIVATE KEY----- in the Certificate.pem file.

API URL: POST https://apisalesdemo4.successfactors.com/oauth/idp

postman1.png

postman2.png

8. POST https://apisalesdemo4.successfactors.com/oauth/token

Parameter:

client_id: YTJlZGJlMDUwYWMzYmViZDI2MGRhYWNiZDYxOA

grant_type: urn:ietf:params:oauth:grant-type:saml2-bearer

company_id: ace89z (your SF instance)

assertion:PD94....

postman3.png

9. Click on send, this will generate the access token and you may copy it.

postman4.png

10. Execute:

GET https://apisalesdemo4.successfactors.com/odata/v2/User('cgrant1')?select=userId, firstName Parameter:

Authorization: Bearer <access token>

Accept: application/json

postman6.png

See Also

KBA 2173792 - How to use Google Rest client to run Odata API

Find more information on the reference guide SAP SuccessFactors HCM Suite OData API: Developer Guide

Keywords

OAuth; OData; Postman; Authentication; Token; Manage OAuth2 Client Applications; X509 certificate; SuccessFactors Integrations; SAP SuccessFactors HCM Suite OData API: Developer Guide , KBA , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , LOD-SF-INT-ODATA , OData API Framework , How To

Product

SAP SuccessFactors HCM Suite all versions