cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the hana cloud account's email

Former Member
0 Kudos

Dear all,

I have a task to retrieve hana cloud account's email from my mobile app. Is it possible to do it? I tried to do it much but i could not find any documentations talk about that.

Accepted Solutions (1)

Accepted Solutions (1)

former_member191806
Active Participant
0 Kudos

Hello Thuan,

I am not sure exactly what you require.

     If we are talking about the cloud account on which the application is hosted (i.e. the one with which you log into the cockpit), then you might have a look at the com.sap.cloud.account Java package. Unfortunately, from what I can see, there is no way to get the Email address (the TenantContext only has methods for getting the account name / tenant ID. This should work for Java based applications / services for a multi-tenant context (normally it should work on the single tenant context as well).

     If you want the current end-user's email account, then it depends if the identity provider (IdP) you are using is also shipping the email address as part of the user attributes. The default IdP is SAP ID, and it does fill in the email address by default. To access it from a Java application, check out Working with user profile attributes (from HCP help), for HTML5 application: Accessing the user API and for an XS application: samlUserInfo object.

Regards,

Serban

Former Member
0 Kudos

Thank Serban. Your answer is quite sufficient. I am building SAP Mobile Application and want to get Hana Cloud User information( the one which i log into the cockpit) and base on the email address which is return from Hana Cloud to use in my mobile app

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hi,

the user's email address should be part of the user attributes as per:

https://help.hana.ondemand.com/help/frameset.htm?9e2e0d7e91cc44e79901a756bf7b2d88.html

however, that said, I can't get the reading of the user attributes to work in the first place

It will depend of course on what attributes the IdP connecting to the HCP account provides - if the IdP provides email address, you should be able to read it.

hope that helps,


Cheers,


Chris

Former Member
0 Kudos

Thanks for your quick answer so much. Though It is not really correct in my case but I got some ideas to do my app.