SFTP Configuration and Usage Guide
* Access the SFTP Platform

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

* Create SFTP instance
- After a successful login, To Create New SFTP instance.

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

After configure SFTP server, we will have some info of it as
- User name
- Password phrase
- Host name
- SFTP Port

* Install WinSCP

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

* Create Known Host in CPI
- Go to integration Suite Application
- Go to Design integration flow
- Go to Monitor item in left menu
- Go to Connectivity Test


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

* Create User Credentials
- Go to integration Suite Application
- Go to Design integration flow
- Go to Monitor item in left menu
- Go to Security Material
- Click on create


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

1. Username/Password :-
Create/Configure an Integration Flow
- We are using HTTPS to send the data {\"productIdentifier\":\"HT-2000\"} because this value needs to be passed to the OData service.

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

- Use the Content Modifier to assign information to headers.

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

- 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'.

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

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

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).

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

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

- Next, use the XML to CSV Converter to send data to the receiver, as the SFTP server only accepts CSV format.

- 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.


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

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

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.

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

Create/Configure an Integration Flow

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

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)
- In the processing tab also configure as per your requirement whether you want to Archive, Keep File and Process Again.

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

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

- 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.

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

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

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

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

Using the same flows, just changing the authentication method from username/password to private key.
- Open the receiver SFTP adapter, select 'Public Key' for authentication, and provide the private key alias and the user name from the SFTP server.

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

- 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.

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

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

- 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.

3. DUAL :-
Using the same flows, just changing the authentication method to Dual.
- Open the receiver SFTP adapter, select 'Dual' for authentication, and provide the private key alias and the Credential name.

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

- 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.

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

Using the same flows, just changing the authentication method to Dual.
- Open the receiver SFTP adapter, select 'Dual' for authentication, and provide the private key alias and the Credential name.

- 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.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.