[IOS Oauth configuration] Mobile services migration from Neo to CF
In our main blog we had details and few links on over all Migration from Neo to CF and a guide for android app migration as well.
In this blog we are going to focus on migrating a iOS application configured with Oauth from Neo to CF.
As the first step lets create an application config in our NEO environment.
- Go to mobile services cockpit, click on “Mobile Applications” and select “Native/Hybrid”
- On click of New button, a popup to create a new application is displayed.
- From the config templates select Native.
- Give a meaningful ID (com.sap.migration.demo)
- Enter the application name.
- Description and vendor are optional.
- Click Save.
- Once the app is created, on the Assigned features tab click on connectivity. Since it’s a new application, there would not be any destination assigned to the application. Click on create button.Choose Type as “Mobile Destination” and give a meaningful name for the destination and click next.Enter the URL “https://sapes5.sapdevcenter.com/sap/opu/odata/sap/EPM_REF_APPS_SHOP_SRV” and click Next. Proceed by clicking Next until you reach the SSO mechanism screen. Choose Basic Authentication for SSO mechanism and click Next. Enter “your ES5 Gateway user ( eg P123456789) and your ES5 Gateway Password”. Hit Next and Finish.
- Go to the assigned features of the app config and select Security. Make sure the Security Configuration is set to Oauth.
- Open ios assistanand and if you are setting up the assistant for the first time at bottom left choose Manage Accounts and select “Add new…” in next screen. Fill the following details.
Account Name NEO mobile services Admin API URL See below for how to get this URL Admin UI URL See below for how to get this URL Authentication Type Basic Username Username for your cloud platform account Password Password for your cloud platform account Save Account Information Check this so that you do not have to re-enter account information on subsequent runs of the wizard
To fetch the Admin URLs go to the Important links section in the SAP CP Mobile Services website.
- Once Mobile services tenant details are filled, you are back to main view. Over here click “Create new” -> select “Reuse Existing Application” -> choose the right mobile services account.
- Choose the right app config which we created in step 2 ( com.sap.iosAppMigration.demo) and click next.
- Give a Suitable Product Name and click next.
- Choose the destination created in step 3 and click next and click finish.
- Now the assistant generates the code and launches the application in xcode.
- Select the right device of your choice and run the application either in device / simulator.
- Now you must recreate the application configuration on CF. To do this you must go back to Mobile Services Neo cockpit and select the app. Once you’re in the app configuration view, click on Export.
- The configuration zip file is saved in your system. Now open the Mobile Services CF tenant and select the Mobile Applications – > Native / Hybrid form the navigation view. Click on Import and select the config file downloaded in above step.
- Once the app is imported into CF, have a look at the application to see that the app configurations are retained in CF as well. This includes the Oauth configuration which was the authentication mechanism in NEO.
- Finally, the mobile application must be adjusted to connect to the Cloud Foundry environment. Usually it is enough to change the target URL in the application, but there may be changes necessary to reflect differences in the security setup.
- We need to change the server url pointing from neo to CF and also change the Oauth values of CF.
- Re-run the application and you would see the app is pointing to CF
Now you have ios application secured with Oauth based authentication having ES5 system as backend system migrated to SAP CP running on CF with minimal number of steps.