{
  "name": "IS Analytics Messages",
  "id": "IsAnalyticsMessages",
  "thumbnailURL": "",
  "configs": {
    "pubsub": {
      "types": [
        "subscriber"
      ]
    },
    "options": [
      {
        "id": "widgetType",
        "title": "Widget Type",
        "type": {
          "name": "ENUM",
          "possibleValues": [
            "Overall",
            "Local",
            "Federated"
          ]
        },
        "defaultValue": "Overall"
      },
      {
        "id": "headerTitle",
        "title": "Widget Display Name",
        "type": {
          "name": "TEXT",
          "possibleValues": []
        },
        "defaultValue": "Login Attempts Messages"
      }
    ],
    "providerConfig": {
      "configs": {
        "type": "SiddhiStoreDataProvider",
        "config": {
          "siddhiApp": "@App:name(\"IS_ANALYTICS_AUTHENTICATION_OVERALL\") @App:description(\"Handle Event from IS and save data in a table for Overall Authentication\") define stream OverallAuthenticationProcessedStream (meta_tenantId int, contextId string, eventId string, eventType string, authenticationSuccess bool, username string, localUsername string, userStoreDomain string, tenantDomain string, remoteIp string, region string, inboundAuthType string, serviceProvider string, rememberMeEnabled bool, forceAuthEnabled bool, passiveAuthEnabled bool, rolesCommaSeparated string, authenticationStep string, identityProvider string, authStepSuccess bool, stepAuthenticator string, isFirstLogin bool, identityProviderType string, timestamp long ); @store(type='rdbms', datasource='IS_ANALYTICS_DB') @primaryKey('meta_tenantId', 'contextId', 'eventId', 'eventType', 'region') define table OverallAuthTable (meta_tenantId int, contextId string, eventId string, eventType string, authenticationSuccess bool, username string, localUsername string, userStoreDomain string, tenantDomain string, remoteIp string, region string, inboundAuthType string, serviceProvider string, rememberMeEnabled bool, forceAuthEnabled bool, passiveAuthEnabled bool, rolesCommaSeparated string, authenticationStep string, identityProvider string, authStepSuccess bool, stepAuthenticator string, isFirstLogin bool, identityProviderType string, utcTime string, timestamp long );",
          "queryData": {
            "query": "from OverallAuthTable {{filterCondition}} and (authenticationSuccess == true or (authStepSuccess == false and eventType == 'step')) select contextId, username, serviceProvider, authenticationStep, rolesCommaSeparated, tenantDomain, remoteIp, region, ifThenElse(authenticationSuccess, 'Success', 'Failure') as authSuccess, utcTime order by utcTime desc",
            "queryLocal": "from OverallAuthTable {{filterCondition}} and identityProviderType=='LOCAL' and eventType!='Step' select contextId, username, serviceProvider, userStoreDomain, tenantDomain, rolesCommaSeparated, remoteIp, region, ifThenElse(authStepSuccess, 'Success', 'Failure') as authSuccess, utcTime order by utcTime desc",
            "queryFederated": "from OverallAuthTable {{filterCondition}} and identityProviderType=='FEDERATED' select contextId, username, serviceProvider, identityProvider, remoteIp, region, ifThenElse(authStepSuccess, 'Success', 'Failure') as authSuccess, utcTime order by utcTime desc"
          },
          "incrementalColumn": "contextId",
          "publishingInterval": 5,
          "purgingInterval": 60,
          "publishingLimit": 30,
          "purgingLimit": 60,
          "isPurgingEnable": false
        }
      }
    }
  }
}
