SAP CPI: Alert Automation
SAP CPI: Alert Automation
Document History
Name Role Date
Shubham Patel SAP CPI Consultant 12th May 2021
1
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
Contents
Introduction.................................................................................................................................................3
Scenario: Integration Flow...........................................................................................................................4
Testing.........................................................................................................................................................6
2
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
Introduction
This Blog describes how to send automated notifications to user mail in case the client certificates in
tenant reaching the expiry dates. It will help in renewal of KeyStore/certificates before it expires.
Preventing messaging error due to invalid certificates
Below is the description of the steps to model a scenario triggered via POSTMAN (You can use scheduler
to schedule the automatic expiry alerts) which checks all entries of the certificate-to-user mapping and
sends a mail with information about those entries reaching their expiry with required information
3
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
Step 1: We will use HTTPS request using HTTPS adapter by defining end point and sending request
through POSTMAN. However, Scheduler should be used to send automated mail as per scheduled time.
Here I have used POSTMAN to explain the ODATA API to retrieve all certificates from TENANT NODE
Step 2: The Request Reply step passes over the message to an ODATA API
https://TENANT_HOST/api/v1
We will import tenant credentials in CPI security stores and configure using same name in ODATA
adapter
4
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
Step3: General Splitter to split all keystore entry based on XPATH defined
Step 4: Content modifier to store the parameter as exchange property from request body. This
parameter will be used in groovy script for logic and mail adapter body
5
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
Step 5: Groovy Script to calculate the expiry time based on certificate expiry date and current date
Step 7:
Router Steps to send alert if days to expire less than 100 days and otherwise send all certificate in
response
Step 8: Now we configure the Mail receiver channel sending out the notification. Configure using mail
credentials imported in security store. Configure Subject , body and attachments
Hi Tenant Administrator,
User: ${property.CreatedBy}
Please reset
Thanks& Regards,
CPI Admin
Under attachment, we can define ${in.body}, this will attach expiring certificate to mail
6
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
Testing
Send the request through POSTMAN using ENDPOINTS configured in HTTPS adapter
We have received response from ODATA API containing all certificates, as default router was configured
So using ODATA url https://TENANT_HOST/api/v1 we can have all types of tenant api
7
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI
THANK YOU,