liveBook · Manning

Authentication trigger

As explained in MongoDB 8.0 in Action, Third Edition

An authentication trigger is a trigger activated by user authentication events such as account creation, login, or deletion.

An authentication trigger automatically invokes server-side logic when a user creates an account, logs in, or deletes an account. It connects authentication activity with application workflows such as messaging and subscriptions. section 19.2.1 section 19.3

Use authentication triggers to respond automatically to:

  • New account registration, such as sending a welcome email. section 19.3
  • User login events and account deletion events. section 19.2.1
  • Registration workflows that automatically subscribe users to a mailing list. section 19.3

Welcome email after registration

Configure an authentication trigger for account creation and associate it with an Atlas Function that sends a welcome email. The trigger starts the function automatically when registration occurs. section 19.3

Figure 19.4 Trigger types in Atlas: database (insert, update, delete, and replace), scheduled (basic and advanced), and authentication (create, login, and delete) (Image © MongoDB 2024 CC BY-NC-SA 3.0)
A diagram of a diagram

Description automatically generated

Use the trigger-type overview to distinguish authentication events from database operations and scheduled executions. section 19.2.1

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Defines supported events and practical uses but stops short of detailed authentication-trigger configuration steps.
Examples
Uses welcome emails and mailing-list subscriptions as registration-triggered workflows.
What it assumes
Requires an associated Atlas Function to control the server-side response.
What you can do after
Apply it via Atlas Functions to automate responses to user authentication events.
How it connects
Connects user authentication events with Atlas Functions and distinguishes them from database and scheduled triggers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.