Ana içeriğe geç

Login Log Connector Configuration

Info

This feature forwards user sign-in/sign-out events to external systems (Elasticsearch, Kafka, Webhook, etc.) through connectors. It applies to API Manager (system users) and API Portal (portal users).

Overview

Apinizer tracks user sign-in/sign-out events in two layers:

SourceWhoSettings Location
API ManagerAdministrators / system usersSystem Settings > SIEM & Log Forwarding (Session stream)
API PortalPortal end users (developers)Portal Settings > Login Log tab

For both layers, records are always written to the Apinizer database and cannot be turned off; you can additionally define one or more connector targets to send the same events to external systems.


1. API Manager – System User Login Log

1.1 Where to Configure

System Settings → SIEM & Log Forwarding → Destinations → Session stream

Info

Connector targets for Management Console login logs are configured on the SIEM & Log Forwarding page, as rules on the Session stream, and no longer under General Settings. That page also lets you filter which login events reach a destination, apply a privacy profile, and switch the payload to the canonical Apinizer JSON v2 envelope. The payload formats documented below are what the Legacy Raw profile produces, unchanged.

1.2 Screen Fields

FieldDescription
Save to DatabaseManagement Console login records are always written to the MongoDB persistent_audit_event collection; this cannot be turned off. The SIEM page shows the stream as Always stored.
Connector TargetsThe destinations that have a rule for the Session stream on the SIEM & Log Forwarding page.

To view Management Console login records, see Login Records.

1.3 Adding a Connector

  1. Open Administration → System Settings → SIEM & Log Forwarding and click Add Destination.
  2. Select a connection configuration (ConnectionConfig) previously defined for the environment.
  3. Switch on the Session stream for that destination and, optionally, narrow it with event types, outcomes or a scope.
  4. Use the Enabled switch to make the destination Active or Inactive.

See SIEM & Log Forwarding for the destination, rule and profile reference.

Info

Connectors are defined per environment. A connection configuration must first be created on the Connection Configuration screen and assigned to the relevant environment.

1.4 Events Emitted

EventeventTypeDescription
Successful loginLOGIN_SUCCESSUsername and password verified
Failed loginLOGIN_FAILUREInvalid credentials or locked account
Sign-outLOGOUTThe user signed out of the Management Console
Token refresh (project switch)TOKEN_REFRESH_SUCCESSThe session token was renewed for a different project
Token refresh deniedTOKEN_REFRESH_FAILUREThe user has no permission in the requested project (reasonCode=NO_PROJECT_PERMISSION)
Account lockedACCOUNT_LOCKEDThe account was locked after too many failed attempts
Password changedPASSWORD_CHANGEDA user's password was set or changed — by the account holder or by an administrator
Password change requiredPASSWORD_CHANGE_REQUIREDThe user signed in with a password that must be changed before anything else can be done
Password policy violationPASSWORD_POLICY_VIOLATIONA password was rejected for not meeting the configured password policy

Every event also carries userAgent, and failed events carry a machine-readable reasonCode. See Login Records for the full field and reason-code reference.

1.5 JSON Payload Sent to Connectors

{
"source": "API_MANAGER",
"principal": "username",
"email": null,
"displayName": null,
"eventDate": "2026-03-31T10:00:00Z",
"eventType": "LOGIN_SUCCESS",
"remoteAddress": "1.2.3.4",
"message": null,
"errorType": null,
"portalId": null,
"accountId": null
}

Graylog connectors receive this same event as a GELF message with the short message LogLogin. When Append to Message is on, the JSON above is written to the GELF full_message field; when Append to Attributes is on, each populated field (source, principal, email, displayName, eventDate, eventType, remoteAddress, message, errorType, portalId, accountId, userAgent, reasonCode, targetProjectId) is sent as a separate GELF additional field. Fields that are null are omitted from the additional fields.

1.6 Failed Login Example

{
"source": "API_MANAGER",
"principal": "username",
"email": null,
"displayName": null,
"eventDate": "2026-03-31T10:01:00Z",
"eventType": "LOGIN_FAILURE",
"remoteAddress": "1.2.3.4",
"message": "Bad credentials",
"errorType": "org.springframework.security.authentication.BadCredentialsException",
"portalId": null,
"accountId": null
}

2. API Portal – Portal User Login Log

2.1 Where to Configure

Portal Management → [Select Portal] → Settings → Login Log tab

API Portal Login Log tab with always-saved warning and connector table
API Portal Settings — Login Log tab

2.2 Screen Fields

FieldDescription
Connector TargetsList of external connection configurations to which login logs are sent.
Info

Portal login log records are always written to the MongoDB portal_login_logs collection; this cannot be turned off. Portal login log settings are independent per portal — each portal can have its own connectors.

This connector list is only used while the Session stream's SIEM authority is Legacy. Once an administrator switches Session to Active on SIEM & Log Forwarding, portal sign-in/sign-out events are delivered by the rules and destinations configured there instead, for every portal at once, and this list stops being used.

To view and filter portal login records, see API Portal Login Logs.

2.3 Adding a Connector

The steps match API Manager:

  1. On the Login Log tab, click + in the connector table.
  2. Select the appropriate connection configuration and save.

2.4 Events Emitted

The portal emits ten event types. For the first two, the eventType sent to a connector is translated to the value existing connectors already expect; every other type is sent with its own name, unchanged:

EventeventType sent to connectorDescription
Successful loginLOGIN_SUCCESSPortal user signed in
Failed loginLOGIN_FAILUREInvalid credentials, or the sign-in was refused for another reason (an account waiting for approval, unconfirmed, disabled, rejected, or belonging to another portal)
Sign-outPORTAL_LOGOUTThe portal user signed out
Account lockedPORTAL_ACCOUNT_LOCKEDThe account was locked after too many failed sign-in attempts
Password changedPORTAL_PASSWORD_CHANGEDThe account's password was changed — self-service, by an administrator, via a reset link, or because a forced/expired password had to be replaced
Password change requiredPORTAL_PASSWORD_CHANGE_REQUIREDThe account must change its password before it can be used further
Password reset requestedPORTAL_PASSWORD_RESET_REQUESTEDThe account holder requested a password reset
Password policy violationPORTAL_PASSWORD_POLICY_VIOLATIONA password was rejected for not meeting the portal's configured password policy
Account disabledPORTAL_ACCOUNT_DISABLEDThe account was disabled — today, only by the inactive-account job
Account unlockedPORTAL_ACCOUNT_UNLOCKEDAn administrator unlocked the account

2.5 JSON Payload Sent to Connectors

{
"source": "API_PORTAL",
"principal": null,
"email": "user@example.com",
"displayName": "Full Name",
"eventDate": "2026-03-31T10:05:00Z",
"eventType": "LOGIN_SUCCESS",
"remoteAddress": "5.6.7.8",
"message": null,
"errorType": null,
"portalId": "portal-abc123",
"accountId": "account-xyz789"
}

3. Supported Connector Types

All Apinizer connector types can be used for login logs. Common scenarios:

Connector TypeTypical Use
ElasticsearchCentralized log search and dashboards (Kibana, etc.)
Kafka / RabbitMQ / ActiveMQReal-time event streaming / SIEM integration
WebhookHTTP POST to any REST endpoint
DatabaseExternal relational database (JDBC), writes to log_LoginLog table
Syslog / GraylogTraditional syslog infrastructure
Info

When the Database connector type is selected, login log records are written to the log_LoginLog table. This table is not created automatically — you must create it manually before enabling the connector. See Apinizer Log Table Creation Commands for the CREATE TABLE statement for each supported database type (Oracle, MySQL/MariaDB, PostgreSQL, SQL Server).


4. Multiple Connectors

You can define multiple connectors for both Manager and Portal. Each connector can be toggled Active or Inactive independently.

When a connector is inactive, nothing is sent to that connector even if a log event occurs.


5. Database Persistence

Login log records are always written to the Apinizer database, for both layers — Management Console records to persistent_audit_event, and portal records to portal_login_logs. Neither can be turned off; the connector targets configured above are an additional copy, sent alongside the database write, not instead of it.


6. Known Limitations / Roadmap

No known limitations at this time.