Subject: SP Retreival of Attribute value
Date: 2016-03-07 18:54:05
From: Jason Baxter
Source: sp-retreival-attribute-value

I'm trying to retreive the attribute value being passed over in a saml response from the idp. Below is a sample of the value I am trying to retreive. I've seen how you can loop through the attributes, but no clear example of how to get the actual AttributeValue.


            <saml:Attribute xmlns:xs=""
                <saml:AttributeValue xsi:type="xs:string">P6IQW21</saml:AttributeValue>

I'm using the floowing code although it currently isn't working.

 samlAssertion = samlResponse.GetAssertions()(0)

 Dim userName As String
 If samlAssertion.AttributeStatements().Count() > 0 AndAlso samlAssertion.AttributeStatements(0).Attributes().Count > 0 AndAlso samlAssertion.AttributeStatements(0).Attributes(0).AttributeValue IsNot Nothing Then
            userName = samlAssertion.AttributeStatements(0).Attributes(0).AttributeValue



---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index