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

Function assertionUID

simplesign_idp_test.go:42–51  ·  view source on GitHub ↗

assertionUID returns the value of the uid attribute DefaultAssertionMaker sets from Session.UserName.

(assertion *Assertion)

Source from the content-addressed store, hash-verified

40// assertionUID returns the value of the uid attribute DefaultAssertionMaker
41// sets from Session.UserName.
42func assertionUID(assertion *Assertion) string {
43 for _, statement := range assertion.AttributeStatements {
44 for _, attr := range statement.Attributes {
45 if attr.FriendlyName == "uid" && len(attr.Values) == 1 {
46 return attr.Values[0].Value
47 }
48 }
49 }
50 return ""
51}
52
53// postForm posts the hidden fields of form to its action and returns the
54// parsed request.

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected