code: func (o *SAMLConnectorV2) MapAttributes(assertionInfo saml2.AssertionInfo) []string {
  	var roles []string
  	for _, mapping := range o.Spec.AttributesToRoles {
  		for _, attr := range assertionInfo.Values {
  			if attr.Name != mapping.Name {
  				continue
  			}
  		mappingLoop:
  			for _, value := range attr.Values {
  				for _, role := range mapping.Roles {
  					outRole, err := utils.ReplaceRegexp(mapping.Value, role, value.Value)
  					switch {
  					case err != nil:
  						if !trace.IsNotFound(err) {
  							log.Debugf("Failed to match expression %v, replace with: %v input: %v, err: %v", mapping.Value, role, value.Value, err)
  						}
  						// if value input did not match, no need to apply
  						// to all roles
  						continue mappingLoop
  					case outRole == "":
  						// skip empty role matches
  					case outRole != "":
  						roles = append(roles, outRole)
  					}
  				}
  			}
  		}
  	}
  	return utils.Deduplicate(roles)
  }
docs: // MapClaims maps SAML attributes to roles