def send_saml_audit_notification(action, request, user_id, group_ids, identity_provider, protocol, token_id, outcome):
 initiator = request.audit_initiator
 target = resource.Resource(typeURI=taxonomy.ACCOUNT_USER)
 audit_type = SAML_AUDIT_TYPE
 user_id = (user_id or taxonomy.UNKNOWN)
 token_id = (token_id or taxonomy.UNKNOWN)
 group_ids = (group_ids or [])
 cred = credential.FederatedCredential(token=token_id, type=audit_type, identity_provider=identity_provider, user=user_id, groups=group_ids)
 initiator.credential = cred
 event_type = ('%s.%s' % (SERVICE, action))
 _send_audit_notification(action, initiator, outcome, target, event_type)

def send_saml_audit_notification ( action , request , user_id , group_ids , identity_provider , protocol , token_id , outcome ) : initiator = request . audit_initiator target = resource . Resource ( typeURI = taxonomy . ACCOUNT_USER ) audit_type = SAML_AUDIT_TYPE user_id = ( user_id or taxonomy . UNKNOWN ) token_id = ( token_id or taxonomy . UNKNOWN ) group_ids = ( group_ids or [ ] ) cred = credential . FederatedCredential ( token = token_id , type = audit_type , identity_provider = identity_provider , user = user_id , groups = group_ids ) initiator . credential = cred event_type = ( '%s.%s' % ( SERVICE , action ) ) _send_audit_notification ( action , initiator , outcome , target , event_type )
send notification to inform observers about saml events .