Subject: Help using AttributeQuery
Date: 2017-12-06 11:55:08
From: chris barney
Source: help-using-attributequery
----------------------------------------------------------------------

I am having some challenges getting an AttributeQuery request working.
 I am fairly new to the SAML world so if I am missing the obvious please help me to understand what needs to be done. 
After a successful authentication I need to pull attributes out of a Shibboleth IDP.

Can you please help understand what I have done wrong, or, what I missed? 
 
Here is how I am attempting to use the use the Shibboleth Attribute Service

    //NOTE: samlResponse is the successful authn response 
    AttributeQuery attributeQuery = new AttributeQuery(); 
    attributeQuery.Destination = AttributeServiceUrl; 
    attributeQuery.Issuer = new Issuer("https://sp.transactsp.com/shibboleth-sp"); 
    attributeQuery .Attributes.Add(new ComponentPro.Saml2.Attribute() { FriendlyName ="givenName" }); 
    attributeQuery .Subject = new Subject(samlAssertion.Subject.NameId); 
    attributeQuery .Sign(x509Certificate); 
    ArtifactResponse artifactResponse = artifactResponse.SendSamlMessageReceiveAftifactResponse( 
           AttributeServiceUrl, attributeQuery);

SendSamlMessageReceiveAftifactResponse throws:
     Saml exception: ComponentPro.Saml.SamlException: Failed to send receive request response over soap. --->  
        ComponentPro.Saml.SamlException: Invalid XML element. This is not a SOAP message. 

Here are the relevant Shibboleth logs: 

    11:57:30.309 - WARN    edu.internet2.middleware.shibboleth.idp.profile.saml2.AttributeQueryProfileHandler:249] - Attribute query did not contain a proper subject
    11:57:30.310 - WARN [edu.internet2.middleware.shibboleth.idp.profile.AbstractSAMLProfileHandler:844] - No peer endpoint available for peer. Unable to send response. 
    11:57:30.326 - DEBUG [edu.internet2.middleware.shibboleth.idp.util.HttpServletHelper:323] - LoginContext key cookie was not present in request
    11:57:30.326 - DEBUG [edu.internet2.middleware.shibboleth.idp.ui.ServiceContactTag:177] - No relying party, nothing to display

Atribute Query xml:

    - 
      https://sp.transactsp.com/shibboleth-sp
    - 
    - 
      
      
    - 
    - 
      
    - 
      
      
      
      
      QF5dzAdvp4xd2c7ksniY9AFS5BQ=
      
      
      aWLb04RFeoguNdhGtYaF71UPXX03TH5sDsqN7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      
      
      
      
      

----------------------------------------------------------------------

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