cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud Platform Custom Principal Attributes

nerevar
Participant
0 Kudos
647

Hello,

I use a custom identity provider to authenticate users on sap portal and I need to pass custom attributes with saml2 authentication to my sapui5 application.

When I try to retrieve connected user information in a sapui5 application I use this :

sap.ushell.Container.getService("UserInfo").getUser()

Unfortunatly the fields available are very limited (name, email and id), I would need more information.

Following the documentation about the use of a custom identity provider (with SAML2) I saw this specification :

Is there a list of all Principal Attribute availables somewhere?
Can we add custom attributes?
and of course is it possible to access those attributes in a sapui5 application? how?


Thanks for your help

Accepted Solutions (1)

Accepted Solutions (1)

lucasvaccaro
Product and Topic Expert
Product and Topic Expert

Hi Maxime,

Regarding your questions:

Is there a list of all Principal Attribute available somewhere? Can we add custom attributes?

Yes, but this is configured on the Identity Provider side.

Is it possible to access those attributes in a sapui5 application? how?

Yes, see Accessing the User API. Example: https://blogs.sap.com/2016/05/23/getting-user-details-in-ui5-hcp/

Best Regards,
Lucas

nerevar
Participant
0 Kudos

Thanks I will try that

nerevar
Participant
0 Kudos

it works ! 🙂

here my mapping form the saml2 IdP


And calling the user api returns what I needed

perfect

Answers (1)

Answers (1)

gregorw
Active Contributor

Hi Maxime,

you can simply install my project HTML5UserAPI as a HTML5 app in you Neo subaccount and get all the details that are sent over from the identity provider.

Best regards
Gregor

nerevar
Participant
0 Kudos

thanks
The user api works like a charm, It would be nice to specify this in the documentation though.
It is not very obvious that the custom attributes are available from here.

have a nice day

gregorw
Active Contributor
0 Kudos

The API is documented: SAP Cloud Platform User API.