WorkOS Docs Homepage
Events
API referenceDashboardSign In
Event typesOverviewOverviewAuthentication eventsAuthentication eventsConnection eventsConnection eventsDirectory Sync eventsDirectory Sync eventsEmail verification eventsEmail verification eventsFeature flag eventsFeature flag eventsInvitation eventsInvitation eventsMagic Auth eventsMagic Auth eventsOrganization eventsOrganization eventsOrganization domain eventsOrganization domain eventsOrganization membership eventsOrganization membership eventsPassword reset eventsPassword reset eventsRole eventsRole eventsSession eventsSession eventsUser eventsUser eventsData syncingOverviewOverviewSyncing with events APISyncing with events APISyncing with webhooksSyncing with webhooksData reconciliationData reconciliationObservabilityStreaming to DatadogStreaming to Datadog
API Reference
API Reference
Integrations
Integrations
Migrate to WorkOS
Migrate to WorkOS
SDKs
SDKs

Authentication events

Events emitted during the authentication flow.

On this page

  • Email verification failed
  • Email verification succeeded
  • Magic Auth failed
  • Magic Auth succeeded
  • MFA failed
  • MFA succeeded
  • OAuth failed
  • OAuth succeeded
  • Password authentication failed
  • Password authentication succeeded
  • Passkey authentication failed
  • Passkey authentication succeeded
  • SSO failed
  • SSO succeeded
  • Radar risk detected

Each step in the authentication flow emits an authentication event. Authentication success events are emitted even when additional steps, such as MFA, are required to complete the process.

Email verification failed Coming soon

Event name: authentication.email_verification_failed

Triggered when a user fails to verify their email.

Email verification failed event
JSON
{
"event": "authentication.email_verification_failed",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "email_verification",
"status": "failed",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"error": {
"code": "invalid_one_time_code",
"message": "Invalid one-time code"
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Email verification succeeded

Event name: authentication.email_verification_succeeded

Triggered when a user successfully verifies their email.

Email verification succeeded event
JSON
{
"event": "authentication.email_verification_succeeded",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "email_verification",
"status": "succeeded",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Magic Auth failed

Event name: authentication.magic_auth_failed

Triggered when a user fails to authenticate via Magic Auth.

Magic Auth failed event
JSON
{
"event": "authentication.magic_auth_failed",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "magic_auth",
"status": "failed",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"error": {
"code": "authentication_method_not_allowed",
"message": "Google OAuth is disabled."
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Magic Auth succeeded

Event name: authentication.magic_auth_succeeded

Triggered when a user successfully authenticates via Magic Auth.

Magic Auth succeeded event
JSON
{
"event": "authentication.magic_auth_succeeded",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "magic_auth",
"status": "succeeded",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

MFA failed Coming soon

Event name: authentication.mfa_failed

Triggered when a user fails to authenticate with a multi-factor authentication code.

MFA failed event
JSON
{
"event": "authentication.mfa_failed",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "mfa",
"status": "failed",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"error": {
"code": "invalid_one_time_code",
"message": "Invalid one-time code."
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

MFA succeeded

Event name: authentication.mfa_succeeded

Triggered when a user successfully authenticates with a multi-factor authentication code.

MFA succeeded event
JSON
{
"event": "authentication.mfa_succeeded",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "mfa",
"status": "succeeded",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

OAuth failed

Event name: authentication.oauth_failed

Triggered when a user fails to authenticate via OAuth.

OAuth failed event
JSON
{
"event": "authentication.oauth_failed",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "oauth",
"status": "failed",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"error": {
"code": "invalid_credentials",
"message": "Invalid credentials."
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

OAuth succeeded

Event name: authentication.oauth_succeeded

Triggered when a user successfully authenticates via OAuth.

OAuth succeeded event
JSON
{
"event": "authentication.oauth_succeeded",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "oauth",
"status": "succeeded",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Password authentication failed

Event name: authentication.password_failed

Triggered when a user fails to authenticate with password credentials.

Password authentication failed event
JSON
{
"event": "authentication.password_failed",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "password",
"status": "failed",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"error": {
"code": "invalid_credentials",
"message": "Invalid credentials."
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Password authentication succeeded

Event name: authentication.password_succeeded

Triggered when a user successfully authenticates with password credentials.

Password authentication succeeded event
JSON
{
"event": "authentication.password_succeeded",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "password",
"status": "succeeded",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Passkey authentication failed

Event name: authentication.passkey_failed

Triggered when a user fails to authenticate with a passkey.

Passkey authentication failed event
JSON
{
"event": "authentication.passkey_failed",
"id": "event_01HS2EAGQA9EZW6D0MFCV5S38D",
"data": {
"type": "passkey",
"status": "failed",
"email": "todd@example.com",
"user_id": "user_01EHWNC0FCBHZ3BJ7EGKYXK0E6",
"error": {
"code": "invalid_credentials",
"message": "Invalid credentials."
},
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"ip_address": "0.0.0.0"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Passkey authentication succeeded

Event name: authentication.passkey_succeeded

Triggered when a user successfully authenticates with a passkey.

Passkey authentication succeeded event
JSON
{
"event": "authentication.passkey_succeeded",
"id": "event_01HS2EAGQA9EZW6D0MFCV5S38D",
"data": {
"type": "passkey",
"status": "succeeded",
"email": "todd@example.com",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"ip_address": "0.0.0.0",
"user_id": "user_01EHWNC0FCBHZ3BJ7EGKYXK0E6"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

SSO failed

Event name: authentication.sso_failed

Triggered when a user fails to authenticate with Single Sign-On.

SSO failed event
JSON
{
"event": "authentication.sso_failed",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "sso",
"status": "failed",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"error": {
"code": "authentication_method_not_allowed",
"message": "SSO is disabled for this environment."
},
"sso": {
"connection_id": "conn_01FKJ843CVE8F7BXQSPFH0M53V",
"organization_id": "org_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E"
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

SSO succeeded

Event name: authentication.sso_succeeded

Triggered when a user successfully authenticates with Single Sign-On.

SSO succeeded event
JSON
{
"event": "authentication.sso_succeeded",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"type": "sso",
"status": "succeeded",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"email": "todd@example.com",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"sso": {
"connection_id": "conn_01FKJ843CVE8F7BXQSPFH0M53V",
"organization_id": "org_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
"session_id": "saml_session_01FKJ843CVE8F7BXQSPFH0M53V"
}
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}

Radar risk detected

Event name: authentication.radar_risk_detected

Triggered when an authentication succeeds but is flagged by Radar. For example, the authentication may have succeeded at passing a Radar challenge.

Radar risk detected event
JSON
{
"event": "authentication.radar_risk_detected",
"id": "event_04FKJ843CVE8F7BXQSPFH0M53V",
"data": {
"auth_method": "magic_auth",
"action": "signup",
"control": "restriction",
"blocklist_type": "ip_address",
"ip_address": "192.0.2.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E"
},
"created_at": "2023-11-18T04:18:13.126Z",
"context": {
"client_id": "client_123456789"
}
}
© WorkOS, Inc.
FeaturesAuthKitSingle Sign-OnDirectory SyncAdmin PortalFine-Grained Authorization
DevelopersDocumentationChangelogAPI Status
ResourcesBlogPodcastPricingSecuritySupport
CompanyAboutCustomersCareersLegalPrivacy
© WorkOS, Inc.