AWS-Twitter-Gmail-Integration with SAP HCI
I want to share this personal Integration project of mine to use SAP HCI integrate with Twitter , Gmail and AWS API Gateway.
What the integration does:
Any public User can make a request and include a hashtag to search for and also an email id where they want the top 100 results sent to them as an email attachment.The format of the result file is very basic.
The first content modifier is setting the twitter and gmail header parameters through Camel Headers.
The Script is doing some checks on body, formatting body and also logging some results.
I want to formally acknowledge Bhavesh Kantilal for all his SAP HCI blogs and they have helped me resolve most of the basic connectivity and security config issues.
I will also not go into security, SSL configs between SAP HCI , Twitter and Gmail systems as they are already documented in other blogs.
I am also working on using SAP API management service on SAP HCP. Its in progress.
The intention behind this fun project is .
- Integrate Twitter and also use it as a potential source of social information that can be used in other services .
- Expose the secured SAP HCI service through a AWS API Gateway to public users who are not SAP HCI and Twitter users.
- Explore the challenges that might be there between AWS and SAP HCI as I am working on Integration Solution for an IOT project that is deployed on AWS but interacts with S/4HANA through SAP HCP/HCI.
Security between AWS and SAP HCI:
- AWS API Gateway has Client certificate security authentication option. The client certificate produced by AWS did not had root certificate . We know that SAP HCI needs approved root certificate in Load Balancer to make SSL connection. I chose to include Basic Authentication as Http Header .
- AWS has templates for integration requests and can be used to program and map parameters and headers.
- The public front of my AWS API service is Non-Secured intentionally so that Anyone can access but can be secured very easily and configured to include App token.
Other findings/Comments :
- I have tested a Client certificate to User mapping scenario by sending the request directly to SAP URL using CURL.It works very good.
curl -X POST -H “Content-Type: application/xml” –data-binary /Users/vishnuvardhan/Documents/req.txt –cert /Users/vishnuvardhan/Documents/<name of P12 file>:<passphrase> –url https://xxx…xx..us2.hana.ondemand.com/cxf/sendemail –verbose
2. using Apache Camel headers was very intuitive and should be fully explored by SAP HCI users.
3. SAP HCI needs to have full REST capability soon. Its badly needed.
How to test from browser:( or any SOAP request tool)
- Go to http://requestmaker.com
- Paste this URL https://4hrlg3478b.execute-api.us-west-1.amazonaws.com/VishnuPreTest
- Paste this sample request. PLEASE CHANGE the hashtag and ANY email id of your choice where you want the file to be sent to.
<?xml version=”1.0″ encoding=”utf-8″ ?>
Please let me know if you have any questions.