cancel
Showing results for 
Search instead for 
Did you mean: 

401 authorization error while calling the CPI service from POSTMAN and SOAP UI

AbdulHammed
Explorer
0 Kudos

Dear Experts,

Up until this past weekend, everything was going well with my SAP Cloud connection login and admin access. However, for the past two days, I've been receiving 401 authorization errors when attempting to contact the CPI services using POSTMAN and SOAP UI.

AbdulHammed_0-1713353972780.png

AbdulHammed_1-1713354103264.png

Kindly help me to understand what am i missing here (password rest also done but still same issue).

Regards, 

Accepted Solutions (0)

Answers (3)

Answers (3)

abdul0012
Discoverer

Hi Abdulhammed,

Authorisation error 401 in some cases is due to a password mismatch.

Using Basic Authentication

I advise you to go BTP account and use credentials in your servicekey of your instance.

(if you have not created a service key to your instance, please create one from the BTP).

Assuming you have created 

abdul0012_0-1713434217922.png

Use the json file {
"oauth": {
"createdate": "2024-04-17T16:17:36.132Z",
"clientid": "sb-d99b13-b0cd-46-b7b0-7f37ed0!b273608|it-rt-f85fd302trial!525",
"clientsecret": "ca9fba-f234-4f94-8be6d856e0b$xuaSSKKrOc41FYM5V_idouu-lUK_wRALujA3TB6KVI=",
"tokenurl": "https://trial.authentication.us10.hana.ondemand.com/oauth/token"
}
}

client ID = Username to use in Postman/ Soap in Basic Authentification

clientsecret = Password

Please note that these variable are very sensitive.

Copy only what is between " " excluding " "

I hope this helps.

Abdul

 

Bais
Participant
0 Kudos

Could you put your http connection properties?

if you want to access to your cpi api from outside you must remove CRSF flag on connection, if you have an OAuth 2.0 keys created in your BTP is better method and more secure. Basic Authentication is not good.

 

chris_75
Explorer
0 Kudos

Hi ,

probably you have configured your HTTP-Adapter with CSRF protection. If so, you first need a token before you are allowed to send payload to your Endpoint on CI. Also as I can see in your screenshots - you are using Basic Auth. That is not recommended. Use OAUTH oder Client Certificates instead.

Hint: Follow the Guided Answer to get more information: 

https://gad5158842f.us2.hana.ondemand.com/dtp/viewer/#/tree/3411/actions/54369:54374/?version=curren...

Best regards

Christian