cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Configure SFTP Authentication in SAP Cloud Integration (CPI) – A Step-by-Step Guide

Naveen94
Newcomer
0 Kudos
463

                SFTP Configuration and Usage Guide

 

* Access the SFTP Platform

Naveen94_0-1750055042999.png

* Sign Up / Log In

  • Use the 'Sign Up / Log In' option to register or enter your account.

Naveen94_1-1750055043001.png

* Create SFTP instance

  • After a successful login, To Create New SFTP instance.

Naveen94_2-1750055043003.png

  • Next, Open the SFTP instance, click on 'Users', and then go to 'Connection Details’.

Naveen94_3-1750055043006.png

After configure SFTP server, we will have some info of it as

  • User name
  • Password phrase
  • Host name
  • SFTP Port

Naveen94_4-1750055043010.png

* Install WinSCP

Naveen94_5-1750055043011.png

  • Here, we create a directory or file in WinSCP to upload or download files from the SFTP server.

Naveen94_6-1750055043015.png

* Create Known Host in CPI
  1. Go to integration Suite Application
  2. Go to Design integration flow
  3. Go to Monitor item in left menu
  4. Go to Connectivity Test

Naveen94_7-1750055043016.png

Naveen94_8-1750055043018.png

  • Open Notepad, paste the Host Key, and save the file with an appropriate name (e.g., hostkey.txt).
  • Add this known host into CPI

Naveen94_9-1750055043024.png

* Create User Credentials

  1. Go to integration Suite Application
  2. Go to Design integration flow
  3. Go to Monitor item in left menu
  4. Go to Security Material
  5. Click on create

Naveen94_10-1750055043026.png

Naveen94_11-1750055043030.png

* To check the user credentials, go to 'Connectivity Test' and click on 'SSH'.

Naveen94_12-1750055043036.png

1. Username/Password :-

 

  • SFTP SENDER IFLOW

     Create/Configure an Integration Flow

  1. We are using HTTPS to send the data {\"productIdentifier\":\"HT-2000\"} because this value needs to be passed to the OData service.

Naveen94_13-1750055043038.png

  1. The JSON to XML Converter is used to convert incoming JSON data into XML, as required by the OData service.

Naveen94_14-1750055043039.png

  1. Use the Content Modifier to assign information to headers.

Naveen94_15-1750055043041.png

  1. Use the Request-Reply step to fetch product details from the OData service.

Naveen94_16-1750055043041.png

  1. The OData service is being accessed from the SAP Business Accelerator Hub (api.sap.com).

In the SAP Business Accelerator Hub, navigate to APIs → ODATA V2, then search for 'Product Master'.

Naveen94_17-1750055043050.png

 Click on "Show API Key" to get the key needed for authentication.

Naveen94_18-1750055043060.png

In the API Specification, you can download the OData EDMX, which is useful when integrating in SAP Cloud Integration (CPI) for OData service modeling.

Naveen94_19-1750055043064.png

In the Configuration Details section, the Sandbox URL helps in forming the complete endpoint URL by replacing the {host} placeholder with the actual hostname when configuring the OData connection in SAP Cloud Integration (CPI).

Naveen94_20-1750055043066.png

  1. Now in the connection, use the Sandbox URL as the Address.

Naveen94_21-1750055043069.png

We are using the data {\"productIdentifier\":\"HT-2000\"} to retrieve the specific product details from the OData service.

Naveen94_22-1750055043072.png

  1. Next, use the XML to CSV Converter to send data to the receiver, as the SFTP server only accepts CSV format.Naveen94_56-1750055512403.png
  2. The SFTP Adapter is configured at the receiver end to deliver the converted CSV file.The directory and address are taken from the SFTP server, the file name is created dynamically, and the credentials are retrieved from the security material.Naveen94_57-1750055563264.pngNaveen94_59-1750055613340.png
  3. Next, save and deploy the integration. Then, open Manage Integration Content and copy the Endpoint URL.Naveen94_60-1750055701549.png

     

  4. Go to Postman, select the GET method, and paste the endpoint URL.

Naveen94_27-1750055043084.png

In the Auth type, select OAuth 2.0, and provide the Client ID, Client Secret, and Token URL from the service instance. Then, click Get New Access Token.

Naveen94_28-1750055043087.png

Naveen94_29-1750055043088.png

Naveen94_30-1750055043093.png

Provide the body data, click on Send, and view the result.

Naveen94_31-1750055043097.png

  1.  Now, go to WinSCP, where you can see the CSV file or data in the specified directory.

Naveen94_32-1750055043100.png

 

 

  • SFTP RECEIVER IFLOW

Create/Configure an Integration Flow

Naveen94_33-1750055043103.png

  1. Open or create an Integration Flow (iFlow).
  2. Connect the sender participant to Start and select the SFTP as adapter. Configure the SFTP adapter as per requirements.

Naveen94_34-1750055043108.png

Make sure that the SFTP credentials are deployed in the below path

Overview --> Manage Security --> Security Material --> Create/Upload Credentials

Check the connectivity test of SFTP adapter in Test Connectivity in the below path

Overview --> Manage Security --> Connectivity Tests --> SSH

Copy the Host Key and paste it in notepad & deploy it in Known Hosts(SSH) file in the below path.

Overview --> Manage Security --> Security Material --> Upload Known Hosts(SSH)

  1.  In the processing tab also configure as per your requirement whether you want to Archive, Keep File and Process Again.

Naveen94_35-1750055043113.png

  1. In the scheduler tab also we need to choose how many times this particular interface needs to be run.

Naveen94_36-1750055043119.png

  1. Use the CSV to XML Converter to transform the incoming CSV file into structured XML format.

Naveen94_37-1750055043121.png

  1. After saving and deploying the integration, go to Monitor → Message Processing → Message Processing Run, click on the end of the run to view the XML data.

Naveen94_38-1750055043125.png

2. PUBLIC KEY :-

 

  • Create SSH KEY :
  1. Go to Monitor > Integrations and APIs, open Manage Keystore, click Create, and select SSH Key to generate a new SSH key.

Naveen94_39-1750055043129.png

  1. After creating the SSH key, click on the three dots (︙) and select Download Public OpenSSH Key.

Naveen94_40-1750055043131.png

Now open the SFTP server. In Windows PowerShell, run the following commands:

  • cd .\Downloads\ – to change the directory to Downloads
  • ls – to list the files and confirm your SSH key is there
  • cat <your_ssh_key_name>.pub – to display the public SSH key

Naveen94_41-1750055043133.png

  1. Copy the displayed public SSH key, open the SFTP server, navigate to Public Keys, paste the key, and click Save.

Naveen94_42-1750055043138.png

  • SFTP SENDER IFLOW

Using the same flows, just changing the authentication method from username/password to private key.

  1. Open the receiver SFTP adapter, select 'Public Key' for authentication, and provide the private key alias and the user name from the SFTP server.

Naveen94_43-1750055043141.png

  1. Next, save and deploy the integration. Then, open Manage Integration Content and copy the Endpoint URL.

Naveen94_44-1750055043147.png

  1. In the Auth type, select OAuth 2.0, and provide the Client ID, Client Secret, and Token URL from the service instance. Then, click Get New Access Token. Provide the body data, click on Send, and view the result.

Naveen94_45-1750055043149.png

  1. Now, go to WinSCP, where you can see the CSV file or data in the specified directory.

Naveen94_46-1750055043152.png

 

  • SFTP RECEIVER IFLOW
  1. Open the sender SFTP adapter, select 'Public Key' for authentication, and provide the private key alias and the user name from the SFTP server.

Naveen94_47-1750055043154.png

  1. After saving and deploying the integration, go to Monitor → Message Processing → Message Processing Run, click on the end of the run to view the XML data.

Naveen94_48-1750055043158.png

3. DUAL :-

 

  • SFTP SENDER IFOW

     Using the same flows, just changing the authentication method to Dual.

  1. Open the receiver SFTP adapter, select 'Dual' for authentication, and provide the private key alias and the Credential name.

Naveen94_49-1750055043161.png

  1. Next, save and deploy the integration. Then, open Manage Integration Content and copy the Endpoint URL.

Naveen94_50-1750055043166.png

  1. In the Auth type, select OAuth 2.0, and provide the Client ID, Client Secret, and Token URL from the service instance. Then, click Get New Access Token. Provide the body data, click on Send, and view the result.

Naveen94_51-1750055043168.png

  1. Now, go to WinSCP, where you can see the CSV file or data in the specified directory.

Naveen94_52-1750055043171.png

 

  • SFTP RECEIVER IFOW

      Using the same flows, just changing the authentication method to Dual.

  1. Open the receiver SFTP adapter, select 'Dual' for authentication, and provide the private key alias and the Credential name.

Naveen94_53-1750055043174.png

  1. After saving and deploying the integration, go to Monitor → Message Processing → Message Processing Run, click on the end of the run to view the XML data.

Naveen94_54-1750055043178.png

Accepted Solutions (0)

Answers (0)