cancel
Showing results for 
Search instead for 
Did you mean: 

How to get current Identity Provider in Java Application in SAP Cloud Platform

ziyi_jiang
Explorer

Hi all,

We would like to get the current identity provider(IDP) in Java codes which iseither IDP's URL or name. For example, the default one is "accounts.sap.com", and it is exactly what we want.

The background is that we have multiple tenancies and each one is using a different IDP. We want our Java Code to be able to know which IDP the tenant will use. The example is shown below.

Is there any API in Java to get the name of the IDP marked in red.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Ziyi,

I haven't tried to get the current IdP URL from within Java code, but you might be interested in using Default Attributes for each IdP to check, where the request is coming from? The default attribute will be sent with every user and will change depending on where the request is coming from.
e.g.

IdP1 -> Default attribute "idpCode" : "IdP1"
IdP2 -> Default attribute "idpCode" : "IdP2"

In Java you can read the idpCode Attribute, like shown here: https://github.com/SAP/cloud-sample-library/blob/master/library/src/main/java/com/sap/hana/cloud/sam...

Not the exact answer to your question. However I hope that might help.

Best regards

Daniel