cancel
Showing results for 
Search instead for 
Did you mean: 

iOS native app - custom login page

javi09
Participant
0 Kudos

Dear experts,

I'm struggling to find ways to create a native iOS app with login page (SAP user/pass) and calling an odata service (on-premise SAP server) inside that app. How can I create a custom login page in my backend system scenario? How should be my mobile app configuration on SCP Mobile Services in terms of the SSO Mechanism?

So far I have configured on SCPms a native app with SSO Basic Authentication, when testing odata I get metadata and some data, but on SDK iOS assistant I only get metadata (EntitySets).

To clarify: My odata service is working for a Fiori app done with webide and I would like to obtain a native not hybrid app.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

aschlosser
Employee
Employee
0 Kudos

Javier, glad you got this going (to some extend). I'd suggest that you now try troubleshooting this step-by-step. If you have access to the SAP backend logs, maybe you can see any traces there why the requests are denied. The Mobile Services Cockpit logs sometimes also show more information. And also on the native client side you should be able to see logging with more information. Which place will give you the hint as in what to fix will depend on the nature of the underlying error - hope you'll find this soon and get going, so you can move on to the more exciting aspects of app development.

Thanks
Andreas

javi09
Participant
0 Kudos

Thank you Andreas for your guidance in this process, I will check all the available logs and try to finish with all this backend Authentication part, that I've always found less interesting, and start with the real / exciting app development.

aschlosser
Employee
Employee
0 Kudos

Good luck with that - hope you're into Xcode by now

Andreas

Answers (4)

Answers (4)

aschlosser
Employee
Employee
0 Kudos

Javier, do you also have your app configured to use 'Basic Authentication' in the security feature of your app? If you had done that, the generated app should show a login screen. The fact that you don't see a login screen in your app seems to indicate that the security configuration for your app is maybe set to 'noauth'?

javi09
Participant

Exactly the security configuration of my app was SAML, now that I set it to Basic in both places Connectivity and Security I can see a login screen for the backend system thanks. But in the onboarding of the app, the authentication against the sap server is giving me "Authentication failed!". I tried with a different app in a different sap server using the same configuration and a very simple odata service (just 1 entitySet) and I got to see the data on my app sometimes, another is also failing authentication again.

The behavior for login seems erratic, could be related to the credentials of my user on the sap server? or the odata service?

javi09
Participant
0 Kudos

OK, I dont know what happen with comments functionality, Ill upload them again.

case 1)

case 2)

aschlosser
Employee
Employee
0 Kudos

Javier - your screenshots don't show up here, can you try fixing this up maybe?

Thanks
Andreas

javi09
Participant
0 Kudos

I tried to fix it, as did not work as a comment I've used answer. Can you show them?

aschlosser
Employee
Employee
0 Kudos

Javier,

If you already have a working configuration on Mobile Services and can receive data - you should just need to use the Assistant and generate an app for existing cloud configuration; this should provide you with a good starting point.

If your app is configured for basic on Mobile Services, the Assistant will use the right Fiori controls for a logon screen in the app.

In general - you may want to consider switching to OAuth on the client side and configure principal propagation to the backend; this is described here: https://blogs.sap.com/2017/06/22/how-to-guide-principal-propagation-in-an-https-scenario/ - just a warning upfront: a lot to read and understand, but excellently written and perfectly doable.

Thanks
Andreas

javi09
Participant
0 Kudos

Thanks for replying Andreas,

I'll give you more details about my configuration on Mobile Services (2 options tried):

1) Using Basic Authentication with my user/pass on SAP server I can obtain the option "destination test" where I get all of the Entity Sets but only Entity Data in some of the sets. On the side of the Assistant the generated app is not showing any logon screen to backend and gets no Entity data at all, Master(EntitySets) > Detail(empty)

2) Using Basic Authentication but leaving empty user/pass on SAP server, the option "destination test" is not available. On the side of the Assistant the app is not generated because invalid metadata file, so that I cannot see any logon screen to backend.

- Could you give me a reason why that happens? Once I have under control the Basic I'll move to your general option authentication mode.

- Javier