cancel
Showing results for 
Search instead for 
Did you mean: 

SAPCP SDK for iOS + SAML Auth - how to access userdata

Former Member
0 Kudos

Hi!

We are implementing an iOS App with the SAPCPms for iOS SDK and are using SAML Authentication (SAP IA Service as provider). The auth part works fine, but we need to get access to the userdata (i.e. username, name and email). Browsing through the SDK documentation didn't give a hint on how to implement this.

We got the tip of a possible workaround via calling https://accounts.sap.com/ui/protected/userData after authentication and parsing the html, but so far no luck. Holding on to the SMP_COOKIE_STORE-cookie doesn't suffice. Is there a way for this to be accomplished (additional headers,..)?

Best Regards, Marlies

Former Member
0 Kudos

Same here - we're also looking to implement a similar feature. The SDK documentation didn't shed any light on this.

Accepted Solutions (0)

Answers (3)

Answers (3)

aschlosser
Employee
Employee
0 Kudos

garin , marlies.strobl ,

We have this API in the SDK now; https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/Latest/en-US/Documents/Frameworks/SAPFound...

Thanks
Andreas

0 Kudos

Hi, when using SAPcpmsUserRoles , i am getting the below error:

Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set

Can you tell me what am i missing in the code?

aschlosser
Employee
Employee
0 Kudos

Marlies,

This information isn't accessible locally on the client. We're working on adding and integrating a service from Mobile Services that can be used to query the username after a successful login. We intend to deliver this service in a future release of the SDK

If you need a faster solution, you might be able to replicate this in your custom app by exposing a service yourself on Cloud Platform (or your backend) that the mobile client can query.

Thanks
Andreas

Former Member
0 Kudos

Hi Andreas,

We would be very interested in such a thing. When could we expect this to be available, if not already?

Thank you

Garin

Qualiture
Active Contributor
0 Kudos

Hi,

I'm not entirely sure, but if I remember correctly, you should provide parameters to specify user data in the SAML assertion? I couldn't find it either, but I would have expected it to be part of the SAPcpmsSettingsParameter object you provide to the SAMLObserver, see https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/Latest/en-US/Documents/Frameworks/SAPFound...

At https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/Latest/en-US/Documents/Frameworks/SAPFound... there are some topics about customisation (no userData though) but maybe this helps?