cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Communication error : Couldn't retrieve oAuth Token

06-22-2022 1:17 PM
17643 views 17 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello experts,

Hope you are doing good!!!

We have a file to REST scenario from ERP to MS Azure via SAP PO where we are picking up a file from SAP folder and passing it to Azure using REST adapter.

On the receiver end, the authentication is Oauth2.0 client credential flow. While testing REST adapter ( Receiver ) in SAP PO 7.5 SP23 we are getting below error "HTTP Communication error : Couldn't retrieve oAuth Token" .

We have tested the API using Postman successfully.

Kindly advice if you have worked on similar configuration.

Below are the configuration and error screenshots for your reference:

Looking forward for your support and suggestions.

Thanks in advance!

Prabhu S

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Hello everyone,

We finally found the fix.

There was no secure connection from PI system to Azure AD server. We had to use a Zscaler proxy server in between to fetch the token.

Answers (5)

Answers (5)

sowmya_venkatesh
Explorer
0 Likes

Hello Prabhu,

Is this issue resolved?

We are facing same issue now.

Could you please let me know how you have resolved the issue?

Regards,

Sowmya

khusal810
Active Participant
0 Likes

Check note 3231228

khusal810
Active Participant
0 Likes

Hi Prabhu,

Were you able to resolve the issue? If yes how?

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

Please share the patch version of SAP_XIAF and SAP_XIAFCON. Thanks,

Regards,

Ramnath

0 Likes

Hi Kottiyil Ramnath Please find the details

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

Please ask your basis team to upgrade these 2 components to the latest service pack. Thanks,

Regards,

Ramnath

0 Likes

Hi kottiyil_ramnath, We are on the latest service pack, checked with the basis team.

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

FYI, SP24 is already released in June. So SP23 is not the latest one anymore. But my ask is not to update Service Pack, I am referring to the patch level of the component.

Currently, yours is on Patch 0 which is the initial version.
Note: SAP_XIAF has dependencies, so basis have to update all those dependencies to the latest patch as well.

Reference: https://launchpad.support.sap.com/#/softwarecenter/object/0020000000708182022


Regards,

Ramnath

0 Likes

Hi kottiyil_ramnath, we have updated the patch version but still same error.

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

Can you send the screenshot of your channel config again? Thanks,

Regards,

Ramnath

0 Likes

Hi kottiyil_ramnath, please refer the Oauth configuration below.

We are able to access API after generating the token from Postman and passing it in headers but it fails if we try via PI.

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

Looking at all screenshots from your topic, Can you do the following and check,

1. Remove the client certificate authentication. You are using Oauth to authenticate.

2. Remove Authorization Header from HTTP headers

3. In Module Bean, remove parameter sap lib, let it use the default one.

4. Add "Oauth20AutorizationServerRequestType" value "query" in parameter section of module bean. (Try with and without this parameter)

If you still have the same issue, do you have XPI inspector installed? If yes, use channel and select your receiver rest channel and gather the logs and attach it here?

Regards,

Ramnath

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

Try

parameter: Oauth20AutorizationServerRequestType
value: query

In module configuration.

Regards,

Ramnath

0 Likes

Hi kottiyil_ramnath, We tried with Oauth20AutorizationServerRequestType:query parameter as well as without any parameter in adapter module but the error is still same.

kottiyil_ramnath
Participant
0 Likes

Hi Prabhu,

Few things i noticed,

1. In your OAuth you already have an option: "Use Credentials and Oauth access token as"; This will take care of using the accessed token value as Header to the final URL. So you dont need "Authorization" header. Try removing it and check.

2. Hope you are using the token URL in Oauth section.

Regards,

Ramnath

0 Likes

Hi kottiyil_ramnath, We tried without Authorization in header still we are getting the same error. Yes, we are using the token URL in Oauth section.