Reputation: 538
I did the following script for mapping an attribute called DocumentType for a SAML response, I have the document type and also document number of the person inside this attribute called LDAP_ID so I need to separate them, I tried like so:
DocumentType=(user.LDAP_ID).substring(0,2);
But when I check the response the value of attribute DocumentType is empty, but my user.LDAP_ID
does contain a value like for example cc23143212, what am I doing wrong?
I also tried to do
DocumentType = String(user.LDAP_ID); // but this is returning undefined
what am I missing?
If I set DocumentType = user.LDAP_ID;
then in the response, this attribute DocumentType contains value cc23143212
UPDATE:
I have another user attribute called username, which also contains the document number and documenttype of the user together like cc23143212, I tried using this attribute and it works, like so:
DocumentType = (user.username).substring(0,2); // returns cc as expected
so I think that the problem is something with the type of variable user.LDAP_ID is not an string or idk really why it does not work with attribute LDAP_ID, please help.
Upvotes: 0
Views: 783
Reputation: 529
If LDAP_ID is stored in an attribute LDAP_ID, you can try
String(user.getAttribute("LDAP_ID")).substring(0,2)
Upvotes: 1