IdP User Attributes in Vision

Is there a way to get the user attribute fields, specifically 'First Name', 'Last Name', and 'Email' that are returned from the Identity Provider in the Vision Client?

This is easy to do via scripting

username = system.tag.readBlocking(['[System]Client/User/Username'])[0].value
user = system.user.getUser('Usersource', username)
contactInfo = {cI.contactType: cI.value for cI in user.getContactInfo()}

print 'First Name:', user.get('firstname')
print 'Last Name:', user.get('lastname')
print 'Email:', contactInfo['email'] if 'email' in contactInfo.keys() else None

Just replace Usersource on the second line with your user source.

User sources aren't identity providers, though. I don't think we request (or keep track of) metadata like this from identity providers, though I could be wrong.

Rookie mistake. Disregard

I think this is why I was confused.

But see now that they want the actual IdP metadata and not the usersource metadata

IdP User Attribute Mapping


Thanks for trying to help, but I am trying to get the identity provider metadata as PGriffith suggested.

Hmm. We should probably expose this in additional client tags or something for IdP logins.

In the meantime, this might get you a user object with the details you want, though there may be unintentional side effects:

from com.inductiveautomation.ignition.client.gateway_interface import GatewayConnectionManager

connection = GatewayConnectionManager.getInstance()
challenge = connection.getAuthChallenge()
user = connection.login(system.project.getProjectName(), challenge)
print user