QueryAttributes asks the IdP's attribute authority for the attributes of the subject identified by nameID, and returns them once the response has been validated with ParseXMLAttributeQueryResponse. The query is made with MakeAttributeQuery and sent with the SAML SOAP binding to the IdP's SOAP Attri
(ctx context.Context, nameID NameID, attributes ...Attribute)
| 182 | // Errors in making or sending the query are returned as they are; an invalid |
| 183 | // response is returned as an *InvalidResponseError. |
| 184 | func (sp *ServiceProvider) QueryAttributes(ctx context.Context, nameID NameID, attributes ...Attribute) (*AttributeQueryResult, error) { |
| 185 | query, err := sp.MakeAttributeQuery(nameID, attributes...) |
| 186 | if err != nil { |
| 187 | return nil, err |
| 188 | } |
| 189 | responseBody, err := sp.postSOAP(ctx, query.Destination, query.SoapRequest(), MaxAttributeQueryResponseSize) |
| 190 | if err != nil { |
| 191 | return nil, fmt.Errorf("attribute query to %s: %w", query.Destination, err) |
| 192 | } |
| 193 | return sp.ParseXMLAttributeQueryResponse(responseBody, query) |
| 194 | } |
| 195 | |
| 196 | // postSOAP sends envelope to location with the SAML SOAP binding, using |
| 197 | // HTTPClient (see ServiceProvider.HTTPClient), and returns the body of the response, |
nothing calls this directly
no test coverage detected