cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix HTTP "401 Unauthorized" error from Postman to SAP Integration Suite?

jeff_t
Explorer
0 Kudos

When I use HTTP POST command from Postman into my SAP Integration Suite account (using BTP Trial Sub-account), I am getting "401 Unauthorized" error. The expected result is "HTTP status 202 Accepted".

I believe the HTTP call is reaching BTP because I am being alerted by IAS of failed logon attempts.

Looking for help with the cause of the "401 Unauthorized" error.

Suggestions also welcome for alternative ways to test the HTTP call, to see if Postman is incorrectly maintained.

  • Using Basic Authentication.
  • {{Username}} in Postman Collection Authorizations was set to the logon details of the BTP sub-account: I have tried both (a) email address [of the SAP Universal ID] and (b) S-User ID. ** UPDATE 13 Sept: S-User ID is incorrect ... see comments against the Answer ***
  • {{Password}} in Postman Collection Authorizations was set to the logon password of the BTP Sub-account. (I have read elsewhere that some special characters cannot be used in passwords when connecting from Postman -> SAP, and the only special characters in my password are dashes '-' and underscores '_'). ** UPDATE 13 Sept: using S-User ID password is incorrect ... see comments against the Answer ***
  • User already has all available Role Collections assigned in BTP.
  • Postman variable {{host}} is set to the Endpoint of the SAP Integration Flow.

postman-http-401-unauthorized-to-integration-suite.jpg

Background: I am doing SAP Learning Course "Developing with SAP Integration Suite", Unit 5 "Modeling Processes > Using Integration Patterns". A JSON file is provided by the course, to be uploaded into Postman, to accompany pre-set example SAP Integration Flows. The Flows have been deployed: 'Generic Receiver' and 'Modeling Basics - Decouple Flows Using JMS').

jeff_t
Explorer
0 Kudos

Also, do I need a Process Integration Runtime Instance for my BTP Sub-account for my scenario to work? I do not yet have any:

I saw that runtime instances exists for anson_lang (screen-shot copied below):

https://answers.sap.com/questions/13951214/401-error-occurs-when-postman-sending-request-to-i.html

Ryan-Crosby
Active Contributor

You can use certificate authentication against an SAP Passport for your S-user ID. You have to follow the instructions noted in 2d. of this help article for the BTP piece: https://help.sap.com/docs/cloud-integration/sap-cloud-integration/install-and-configure-mendelson. Once you have that in place you can reference your private key in Postman for authentication against the CPI host.

dnguyen_31
Participant
0 Kudos

Hi Jeff,

We ran into the same issue. Were you able to resolve the issue? Is so, can you please share with us.

Thanks again,

David

Accepted Solutions (1)

Accepted Solutions (1)

mastanvalim
Participant
0 Kudos

Hi Jeff,

yes, you need to create instances manually or running boosters and useservice key credentials in postman.

or

if your userid has admin role then use your username and password in postman.

Mastan

jeff_t
Explorer
0 Kudos

Thanks Mastan,

I was successful as per your suggestion - I got "202 Accepted" response, with a correct answer.

Detailed steps

  1. Create a Subaccount Instance with Grant Type = 'Client Credentials' and Plan = 'integration-flow' (if it was missing).
  2. Create Service Key with Key Type = 'ClientID/Secret'.
  3. In Postman, go to the Collection. Create 3 Variables and copy the values from BTP for clientID, clientsecret and url. (I named my 3rd variable 'host' instead of 'url', since '{{host}}' is already pre-poulated in the Postman POST command).
  4. Choose Authorization Type = 'Basic Auth' for the Collection, and assign Username = {{clientid}} and Password = {{clientsecret}}. (Hint: do NOT use S-User ID and password).

(The use of variables is recommended for security reasons, especially if the Collection is shared amongst users)

Note: I did try importing a root certificate from Integration Suite into Postman, but this didn't work and I was successful without using the certificate.

Answers (0)