100% found this document useful (2 votes)
1K views8 pages

SAP CPI: Alert Automation

This document describes an integration flow to send automated email alerts when client certificates in a tenant are approaching their expiration dates. The flow uses a HTTPS request to retrieve all certificates from the tenant using an OData API. A splitter and content modifier separate the certificate details. A groovy script calculates the days until expiration and a mail adapter sends alerts for certificates expiring soon, along with attachment of full certificate details. Testing is done using Postman to trigger the flow and verify email alerts are correctly sent.

Uploaded by

shubham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views8 pages

SAP CPI: Alert Automation

This document describes an integration flow to send automated email alerts when client certificates in a tenant are approaching their expiration dates. The flow uses a HTTPS request to retrieve all certificates from the tenant using an OData API. A splitter and content modifier separate the certificate details. A groovy script calculates the days until expiration and a mail adapter sends alerts for certificates expiring soon, along with attachment of full certificate details. Testing is done using Postman to trigger the flow and verify email alerts are correctly sent.

Uploaded by

shubham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

AUTOMATIC CERTIFICATE EXPIRY ALERT CPI

Automatic Certificate EXPIRY


ALERT CPI

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

Scenario: Integration Flow

Below is integration flow designed

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

ODATA message protocol: OData V2

4
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI

We will define the query based on KeyStoreEntries

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

Also, it will return message payload as attachments

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,

Below Certificate details with Alias ${property.Alias} is expiring on ${property.ValidNotAfter}

User: ${property.CreatedBy}

Days Left: ${property.daysToExpire}

Please reset

Attached is the certificate details

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

Alert mail is sent to User with detailed information

7
AUTOMATIC CERTIFICATE EXPIRY ALERT CPI

We have successfully automated the certificate expiry alerts…!!!!

THANK YOU,

You might also like