QueryAttributes asks the IdP's attribute authority for attributes of the user of the request's session, with ServiceProvider.QueryAttributes, and returns what it returns. The query is made with the request's context. The user is named by the NameID the session was made from, with the Format and qua
(r *http.Request, attributes ...saml.Attribute)
| 35 | // ServiceProvider.MakeAttributeQuery. The result describes the user; it does |
| 36 | // not authenticate them. |
| 37 | func (m *Middleware) QueryAttributes(r *http.Request, attributes ...saml.Attribute) (*saml.AttributeQueryResult, error) { |
| 38 | nameID, err := m.sessionSAMLNameID(r) |
| 39 | if err != nil { |
| 40 | return nil, fmt.Errorf("saml: cannot query attributes: %w", err) |
| 41 | } |
| 42 | return m.ServiceProvider.QueryAttributes(r.Context(), nameID, attributes...) |
| 43 | } |
| 44 | |
| 45 | // sessionSAMLNameID returns the full NameID of the request's session. |
| 46 | func (m *Middleware) sessionSAMLNameID(r *http.Request) (saml.NameID, error) { |