SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Authenticate once and share data between multiple application

Use the Onboarding flow to authenticate once and share data between multiple business applications built with SAP BTP SDK for iOS.

Overview

🎓 beginner 15 min. Ios Sdk For SAP BTPBeginnerIosMobileSAP Business Technology PlatformSAP Mobile Services
Unknown U Unknown January 9, 2023
Created by November 17, 2022
Contributors

Prerequisites

Prerequisites

Steps

Details

You will learn

As of version 2.1, the SAP BTP SDK for iOS now incorporates the possibility to provide a shared logon experience for multiple applications. In addition, data can be shared between applications using the SDK’s KeychainStoreManager.

In this tutorial, you will create two applications. The first app will be used to store data from the secure store, and the second app will retrieve the data stored by the first app. In addition, you will also experience the shared logon mechanism.

Please note the apps created in this tutorial are meant show the basic principles of setting up a shared store between multiple apps. In productive code, you normally should not hard-code the cipher and password in the AppDelegate.swift file, but use a more secure way of handling these. However, for the brevity of the tutorial and easier understanding of what is happening, this choice was made.

Also, if you are working on the trial instance of SAP BTP, make sure you have a maximum of 3 application definitions defined in SAP Mobile Services for development and operations. Since the trial allows a maximum of 5 native mobile applications, you should have a maximum of 3 application definitions defined. If you have 4 or more applications defined, log on to your SAP Mobile Services for development and operations cockpit first, and export & delete any unused applications.

Time to Complete

15 Min


Step 1 Create 'SharedOne' Xcode project with SAP BTP SDK Assistant for iOS
โ€”

On your local machine, navigate to your ./<SAP BTP SDK for iOS> folder. Double-click the SAP BTP SDK Assistant for iOS icon to start the application.

Click the Plus button on the top-right of the SAP BTP SDK Assistant for iOS. The first page of the Xcode Project generation wizard lets you define the Project Properties.

Enter the following details:

FieldValue
Product NameSharedOne
Author<your name>
Organization Name<your company name>
Organization Identifiercom.sap.tutorials.demoapp
Destination<choose a local destination>

Create Xcode project with SAP BTP SDK Assistant for iOS
Create Xcode project with SAP BTP SDK Assistant for iOS

Click Next to advance to the SAP Mobile Services for development and operations Configuration step.

In the SAP Mobile Services for development and operations Configuration page, select the Sample tab button.

Create Xcode project with SAP BTP SDK Assistant for iOS
Create Xcode project with SAP BTP SDK Assistant for iOS

The Sample Application Identifier and Sample Application Name are now pre-filled with the Bundle Identifier value from the previous page.

Click Next to advance to the OData Services step.

In the OData Services page, the Sample OData service connection you have specified in the previous wizard step is displayed:

Create Xcode project with SAP BTP SDK Assistant for iOS
Create Xcode project with SAP BTP SDK Assistant for iOS

Click Next to advance to the Optional Features step.

In the Optional Features page, you have the option to generate a Master-Detail Application, enable logging and log uploads, and enable remote notifications. Since you’re using the Sample OData service, all settings are enabled but greyed out.

Create Xcode project with SAP BTP SDK Assistant for iOS
Create Xcode project with SAP BTP SDK Assistant for iOS

After you have clicked Finish in the previous step, the SAP BTP SDK Assistant for iOS now loads the OData service’s metadata. This metadata describes the data model, and can be accessed via <service URL>$metadata. For your service, the metadata URL would be https://hcpms-<your account>trial.hanatrial.ondemand.com/SampleServices/ESPM.svc/$metadata

After the SAP BTP SDK Assistant for iOS has finished, Xcode will launch and open the just generated SharedOne project.

Step 2 Enable App Groups entitlement
+
Step 3 Modify Onboarding flow
+
Step 4 Create 'SharedTwo' Xcode project with SAP BTP SDK Assistant for iOS
+
Step 5 Store data in 'SharedOne' app
+
Step 6 Run 'SharedOne' app
+
Step 7 Read data in 'SharedTwo' app
+
Step 8 Run 'SharedTwo' app
+
Step 9 Test the shared logon experience
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 9
1. Create 'SharedOne' Xcode project with SAP BTP SDK Assistant for iOS 2. Enable App Groups entitlement 3. Modify Onboarding flow 4. Create 'SharedTwo' Xcode project with SAP BTP SDK Assistant for iOS 5. Store data in 'SharedOne' app 6. Run 'SharedOne' app 7. Read data in 'SharedTwo' app 8. Run 'SharedTwo' app 9. Test the shared logon experience

Learn more →