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

Method QueryAttributes

samlsp/middleware_attribute_query.go:37–43  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

35// ServiceProvider.MakeAttributeQuery. The result describes the user; it does
36// not authenticate them.
37func (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.
46func (m *Middleware) sessionSAMLNameID(r *http.Request) (saml.NameID, error) {

Calls 1

sessionSAMLNameIDMethod · 0.95