0

I recently configured mi Java app in order to login via SAML 2.0 with AppId and an Identity Provider. So i have the login working fine. The issue is: my java webapp needs to get the email from the user that had login, but I cannot manage to do this from AppId or the identity provider.

How can i get from backend the email of the user that is using the app and had done the login with AppId?

When i used LDAP for the old login, I did that something like this:

userEmail = request.getRemoteUser().trim();

I want to do the same but now using AppId. Using that same method above gives me a code, I think it's the token id or something like that, with the format:

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx

Thanks!

  • I had hooked up this file / repo with AppID and SAML a long time ago. IIRC The trick was to configure SAML to return the email address as identifier. In the source, I can extract the email off the token. https://github.com/IBM-Cloud/github-traffic-stats/blob/master/backend/ghstats.py https://github.com/IBM-Cloud/github-traffic-stats – data_henrik May 20 '20 at 17:59
  • In order to do that, should i edit my identity provider settings? I don´t have any access from java 'cause I haven't fount any api to access the appid instance. How can I configure SAML to return the email? – Julian Buranits May 20 '20 at 18:11
  • There is a mgmt API for AppID, see here: https://cloud.ibm.com/docs?tab=api-docs&category=security It is a long time ago, hence I only pointed it out and didn't try to create an answer. I had to go through a config menu with my SAML provider. – data_henrik May 20 '20 at 18:27

0 Answers0