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:AttributeStatement>
            <saml:Attribute xmlns:xs="http://www.w3.org/2001/XMLSchema"
                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            Name="edu/tmc/uth/uuid"
                            NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"
                            >
                <saml:AttributeValue xsi:type="xs:string">P6IQW21</saml:AttributeValue>
            </saml:Attribute>
        </saml:AttributeStatement>

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