Skip to Content

Linkedin Integration with CPI using HTTP OAuth2

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

Add comment
10|10000 characters needed characters exceeded

  • 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

    xmkvm.png (7.9 kB)
    sxmj8.png (9.4 kB)
  • Follow
  • Get RSS Feed

1 Answer

  • Dec 25, 2018 at 02:44 PM

    Hello Karan,

    Please refer below blog which might help you.

    LinkedIn Integration

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • Karan,

      If you are able to do the authentication in script well and good, no need to use connectors. The whole idea of SAP brining in connectors is to reduce the complexity of integration. In your case, if you would have used the built-in LinkedIn connector then you would need not to use that script the connector itself will take care of any such complex authentication.

      Br,

      Manoj