MCPcopy Create free account
hub / github.com/crewjam/saml / QueryAttributes

Method QueryAttributes

service_provider_attribute_query.go:184–194  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

182// Errors in making or sending the query are returned as they are; an invalid
183// response is returned as an *InvalidResponseError.
184func (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,

Callers

nothing calls this directly

Calls 4

MakeAttributeQueryMethod · 0.95
postSOAPMethod · 0.95
SoapRequestMethod · 0.45

Tested by

no test coverage detected