Authgear
Start BuildingHomePortalCommunity
  • Authgear Overview
  • Get Started
    • Start Building
    • 5-Minute Guide
    • Single-Page App
      • JavaScript (Web)
      • React
      • Angular
      • Vue
    • Native/Mobile App
      • iOS SDK
      • Android SDK
        • Android Kotlin coroutine support
        • Android OKHttp Interceptor Extension (Optional)
      • Flutter SDK
      • React Native SDK
      • Ionic SDK
      • Xamarin SDK
      • Using Authgear without SDK (Client side)
    • Regular Web App
      • Express
      • Next.js
      • Python Flask App
      • Java Spring Boot
      • ASP.NET Core MVC
      • Laravel
      • PHP
    • Backend/API Integration
      • Validate JWT in your application server
      • Forward Authentication to Authgear Resolver Endpoint
    • AI Coding tools
      • Cursor/Windsurf
  • How-To Guides
    • Authenticate
      • Add Passkeys Login
      • Add WhatsApp OTP Login
      • Add Email Magic Link Login
      • Add Biometric Login
      • Add Anonymous Users
      • Add authentication to any web page
      • Enable Two-Factor Authentication (2FA)
      • How to Use the OAuth 2.0 State Parameter
      • Reauthentication
      • How to Use Social/Enterprise Login Providers Without AuthUI
      • Passwordless Login for Apple App Store Review
      • Setup local development environment for Cookie-based authentication
      • Forgot/Reset Password settings
      • Phone number validation
      • Set Password Expiry
    • Single Sign-on
      • App2App Login
      • Pre-authenticated URLs
      • SSO between Mobile Apps / Websites
      • Force Authgear to Show Login Page
      • Single Sign-On with OIDC
      • Single Sign-On with SAML
        • Use Authgear as SAML Identity Provider for Salesforce
        • Use Authgear as SAML Identity Provider for Dropbox
        • SAML Attribute Mapping
    • Social Login / Enterprise Login Providers
      • Social Login Providers
        • Connect Apps to Apple
        • Connect Apps to Google
        • Connect Apps to Facebook
        • Connect Apps to GitHub
        • Connect Apps to LinkedIn
        • Connect Apps to WeChat
      • Enterprise Login Providers
        • Connect Apps to Azure Active Directory
        • Connect Apps to Microsoft AD FS
        • Connect Apps to Azure AD B2C
      • Force Social/Enterprise Login Providers to Show Login Screen
    • Built-in UI
      • Branding in Auth UI
      • User Settings
      • Privacy Policy & Terms of Service Links
      • Customer Support Link
      • Custom Text
    • Custom UI
      • Authentication Flow API
      • Implement Authentication Flow API using Express
      • Implement Authentication Flow API using PHP
      • Add Custom Login/Signup UI to Native Apps
      • Manually Link OAuth Provider using Account Management API
      • Implement a custom account recovery UI using Authentication Flow API
    • Integrate
      • Add custom fields to a JWT Access Token
      • User Analytics by Google Tag Manager
      • Track User Before and After Signup
      • Custom domain
      • Custom Email Provider
      • Custom SMS Provider
        • Twilio
        • Webhook/Custom Script
    • Monitor
      • Audit Log For Users Activities
      • Audit Log for Admin API and Portal
      • Analytics
    • User Management
      • Account Deletion
      • Import Users using User Import API
      • Export Users using the User Export API
      • Manage Users Roles and Groups
      • How to Handle Password While Creating Accounts for Users
    • User Profiles
      • What is User Profile
      • Access User Profiles
      • Update User Profiles
      • Profile Custom Attributes
      • Update user profile on sign-up using Hooks
    • Events and Hooks
      • Event List
      • Webhooks
      • JavaScript / TypeScript Hooks
      • Only Allow Signups from Inside the Corporate Network using Hooks
    • Mobile Apps
      • Use SDK to make authorized API calls to backend
      • Force authentication on app launch
      • Customize the Login Pop-up / Disable the login alert box
    • Languages and Localization
    • Custom Email and SMS Templates
    • Directly accessing Authgear Endpoint
    • Migration
      • Bulk migration
      • Rolling migration
      • Zero-downtime migration
    • Troubleshoot
      • How to Fix SubtleCrypto: digest() undefined Error in Authgear SDK
      • How to Fix CORS Error
  • Concepts
    • Identity Fundamentals
    • Authgear use cases
    • User, Identity and Authenticator
  • Security
    • Brute-force Protection
    • Bot Protection
    • Non-HTTP scheme redirect URI
    • Password Strength
  • Reference
    • APIs
      • Admin API
        • Authentication and Security
        • API Schema
        • Admin API Examples
        • Using global node IDs
        • Retrieving users using Admin API
        • User Management Examples
          • Search for users
          • Update user's standard attributes
          • Update user's picture
          • Generate OTP code
      • Authentication Flow API
      • OAuth 2.0 and OpenID Connect (OIDC)
        • UserInfo
        • Supported Scopes
      • User Import API
      • User Export API
    • Tokens
      • JWT Access Token
      • Refresh Token
    • Glossary
    • Billing FAQ
    • Rate Limits
      • Account Lockout
  • Client App SDKs
    • Javascript SDK Reference
    • iOS SDK Reference
    • Android SDK Reference
    • Flutter SDK Reference
    • Xamarin SDK Reference
  • Deploy on your Cloud
    • Running locally with Docker
    • Deploy with Helm chart
    • Authenticating HTTP request with Nginx
    • Configurations
      • Environment Variables
      • authgear.yaml
      • authgear.secrets.yaml
    • Reference Architecture Diagrams
      • Google Cloud Reference Architecture
      • Azure Reference Architecture
      • AWS Reference Architecture
      • Throughput Scaling Reference
Powered by GitBook
On this page
  • View and retrieve logs
  • View in Portal
  • Retrieve with Admin API
  • Log events
  • Log data

Was this helpful?

Edit on GitHub
  1. How-To Guides
  2. Monitor

Audit Log For Users Activities

PreviousMonitorNextAudit Log for Admin API and Portal

Last updated 10 months ago

Was this helpful?

Authgear provides the event logs for you to analyze security issues and monitor the business.

View and retrieve logs

You can view the audit log in the Portal, or retrieve logs using the .

View in Portal

The portal provides an interface for you to look up the log by event and date range.

The Users Activities tab on the Audit Log page filters the log to only show activities performed by a normal user or by an admin on a user's profile.

Retrieve with Admin API

query {
  auditLogs(first:5){
    edges{
      node{
        activityType
        clientID
        createdAt
        data
      }
    }
  }
}

Filtering Audit Log

When using the Admin API, you can filter the Audit Log by an attribute like activityTypes to omit records you're not interested in.

The following is an example that includes filters.

query {
  auditLogs(first:5, activityTypes:[USER_AUTHENTICATED,USER_DELETED]){
    edges{
      node{
        activityType
        clientID
        createdAt
        data
      }
    }
  }
}

The above query will only return events with activity types USER_AUTHENTICATED and USER_DELETED.

Log events

Here is the list of activity types that are logged:

Authentication failed

Activity type
Description

AUTHENTICATION_IDENTITY_ANONYMOUS_FAILED

Anonymous user authentication failed

AUTHENTICATION_IDENTITY_BIOMETRIC_FAILED

Authentication with biometric failed

AUTHENTICATION_IDENTITY_LOGIN_ID_FAILED

A user's login attempt failed because the email or user ID provided is not found

AUTHENTICATION_PRIMARY_OOB_OTP_EMAIL_FAILED

Authentication using the OTP sent via email failed

AUTHENTICATION_PRIMARY_OOB_OTP_SMS_FAILED

Authentication using the OTP sent via SMS failed

AUTHENTICATION_PRIMARY_PASSWORD_FAILED

A user entered an invalid password during a login attempt

AUTHENTICATION_SECONDARY_OOB_OTP_EMAIL_FAILED

2FA via email failed

AUTHENTICATION_SECONDARY_OOB_OTP_SMS_FAILED

2FA via SMS failed

AUTHENTICATION_SECONDARY_PASSWORD_FAILED

Secondary authentication using password failed

AUTHENTICATION_SECONDARY_RECOVERY_CODE_FAILED

Recovery code verification failed

AUTHENTICATION_SECONDARY_TOTP_FAILED

A 2FA attempt failed

Identity changes

Activity type
Description

IDENTITY_BIOMETRIC_DISABLED

Biometric login is disabled by a user or an admin

IDENTITY_BIOMETRIC_ENABLED

User enabled biometric login

IDENTITY_EMAIL_ADDED

A user or admin added a new email to an existing user

IDENTITY_EMAIL_REMOVED

An email address was removed from an existing user's profile

IDENTITY_EMAIL_UPDATED

A user updated their email address

IDENTITY_OAUTH_CONNECTED

A profile is linked to OAuth

IDENTITY_OAUTH_DISCONNECTED

A profile is unlinked from OAuth

IDENTITY_PHONE_ADDED

A user or admin added a new phone number to an existing user

IDENTITY_PHONE_REMOVED

A phone number was removed from an existing user's profile

IDENTITY_PHONE_UPDATED

A user updated their phone number

IDENTITY_USERNAME_ADDED

A user or admin added a new username to an existing user

IDENTITY_USERNAME_REMOVED

A user or admin removed the username for a user

IDENTITY_USERNAME_UPDATED

The username for a user was updated

User actions

Activity type
Description

USER_ANONYMOUS_PROMOTED

This event is triggered when an anonymous user is promoted to a normal user

USER_AUTHENTICATED

Successful user sign-in

USER_CREATED

A new user successfully registered

USER_DELETED

A user account is deleted

USER_DELETION_SCHEDULED

A user account deletion is scheduled

USER_DELETION_UNSCHEDULED

A previously scheduled user deletion is unscheduled

USER_DISABLED

User account disabled. An admin disabling a users account can trigger this event

USER_PROFILE_UPDATED

A user updated details like their profile name, gender and more

USER_REENABLED

A user account that was previously disabled is enabled

USER_SESSION_TERMINATED

An active user session is terminated

USER_SIGNED_OUT

A user that was signed in logged out

Others

Activity type
Description

WHATSAPP_OTP_VERIFIED

User completed a verification process using WhatsApp to receive OTP

SMS_SENT

An SMS notification like OTP was sent to a user

EMAIL_SENT

An email notice like verification code was sent to a user

Log data

Each audit log event contains the following attributes in their data

Attribute
Description

id

Unique identifier of the event

seq

Sequence number of the event

type

Activity type

context

The who, when and where of the event triggered. e.g. IP address, user agent, user ID, timestamp

payload

Relevant data according to the event type:

Messaging (SMS, Email OTP): the phone number/email address of the receiver

Authentication/Identity/User actions: a snapshot of the related session and user attributes

The API schema can be found in the . For example:

Admin API
Admin API GraphiQL Explorer