cancel
Showing results for 
Search instead for 
Did you mean: 

Linkedin Integration with CPI using HTTP OAuth2

former_member285898
Participant
0 Kudos

Hello All,


I am trying to build Linkedin Integration scenario using CPI.

Scenario: SOAP->CPI->HTTP

I have extracted below all required information from Linkedin Developer portal which is required for OAuth2.

1) Client ID

2) Client Secret

3) Access Token

4) Auth URL

I have tested message using Postman tool, it is working fine and message get posted at Linkedin.

Issues in CPI:

1) In Manage Security Material page:

a) Under OAuth2 Credential -> Client Credential, there is no option to maintain Access Token, also what in scope what need to maintain?

b) Can i use OAuth2 Credential -> OAuth2SAMLBearerAssertion? But for this i don't have required information for authentication.

2) As CPI do not support REST Adapter, I need to use HTTP Adapter by default. I was referring below blog from Mr. Eng swee to post message to HTTP using OAuth2.

URL :

https://blogs.sap.com/2015/12/18/hci-developing-custom-oauth-20-authentication-in-iflows/

a) But as per blog i can not generate Access Token on run time for Linkedin, also generated Access token is 500 char long which i can not maintain in Secure parameters.

b) Also how to use OAuth2 Credential in Groovy script to passing HTTP header, and how to pass below HTTP header parameters in groovy script.

- Authorization ( Bearer "Access Token value")

- Connection (Keep-Alive)

- Content-type (application-json)

- x-li-format (json)

Kindly help for this and let me know in case more information required.

Thanks & Regards,

Karan Kholakiya

former_member285898
Participant
0 Kudos

Hello Expert,


I have created scenario and configured HTTP Receiver Adapter with below details.

And passing below header details using Groovy Script:

But now i am getting below error while pushing data:

Error : org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://api.linkedin.com/v1/people/%7E/shares?format=json with statusCode: 405

I checked full log details of message, unable to find any issue with HTTP header parameters and body message passing perfectly as required.

Queries:

1) I noticed one thing SAP includes some own HTTP header parameters as below:

-SAP-PASSPORT

-SAP_MessageProcessingLogID

-SAP_MplCorrelationId

-SAP_PregeneratedMplId

So above HTTP header parameters causing an issue?

2) Also is this scenario achievable by OData Receiver Adapter.

I am not sure how to configure OData Receiver Adapter with below POST method URL only.

URL: https://api.linkedin.com/v1/people/~/shares?format=json

Kindly help for it and let me know if more information required.


Thanks & Regards,

Karan Kholakiya

Accepted Solutions (0)

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Karan,

Please refer below blog which might help you.

LinkedIn Integration

Regards,

Sriprasad Shivaram Bhat

former_member285898
Participant
0 Kudos

Hi Sriprasad,


Thanks for sharing link...!!!

But i have below queries:-

1) Is it mandatory to go via Cloud connector while posting to Linkedin?

As in my scenario i have created Access token and which i am passing through Groovy script for HTTP headers. Also My scenario running perfectly through direct Postman tool (Without SAP CPI).

2) In your blog you using OAuth API Key, Is it Client ID provided by Linkedin ?

It will be helpful if you provide this information.

Thanks & Regards,

Karan Kholakiya