GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
User Guide
  • Quick Start

  • Authentication

    • Overview
    • Username Password Authentication
    • SMS Code Authentication
    • Social Login Authentication
    • QR Code Login

    • Authentication in Mini Programs
    • Implement Single Sign-On (SSO)
    • Mobile SSO
    • Multi-factor Authentication
    • Extend Authentication Process

      • Add Custom Fields to IdToken
      • Extend Authentication Process with Pipeline
      • Monitor Authentication Events with Webhook
    • Customize Login UI
  • Access Control

  • Authorization

  • Adaptive MFA

  • User Account Management

  • User Directory Management

  • Applications

  • Become a Federation Authentication Identity Provider

  • Connect External Identity Providers (IdP)

  • WeChat Ecosystem Full Scenario Capabilities

  • Migrate Users to GenAuth

  • Security Settings

  • Branding

  • Automation

  • Audit Logs

  • Setting

  • FAQ

  1. User Guide
  2. /
  3. Authentication
  4. /
  5. Extend Authentication Process
  6. /
  7. Extend Authentication Process with Pipeline

¶ Use Pipeline to extend the authentication process

Update time: 2025-07-23 07:34:21
Edit

GenAuth Pipeline is a set of user-defined JavaScript codes running in the cloud, which allows developers to extend and customize GenAuth capabilities.

GenAuth Pipeline functions are all user-defined, and we also provide rich function templates (opens new window) to help developers quickly get started with development.

At the same time, Pipeline is a set of functions. The difference from ordinary Hooks is that the function data in the entire process of Pipeline can be passed to each other to achieve the same effect as industrial assembly lines. This design pattern can make the developer's custom functions more modular and easy to manage.

GenAuth Pipeline backend uses serverless architecture. All user-defined codes run in the cloud to ensure isolation between different tenants. At the same time, it can be elastically scaled, which not only ensures security, but also improves operating efficiency.

You can use GenAuth Pipeline to achieve the following functions:

  • Whitelist mechanism: such as registered email suffix whitelist, registered IP whitelist, etc.
  • Event notification: such as sending group notifications after user registration, user login IP abnormality notification, etc.
  • Permission control: such as adding users to a user group based on their email addresses after they log in.
  • Extending user fields: such as adding custom Metadata to the requesting user, etc.
  • Custom token: such as adding custom fields to the token, etc.
  • ... and more, the imagination space is endless.

For example, through the following code, we can implement the logic of disallowing email registration that does not end with example.com:

async function pipe(user, context, callback) {
  const { email } = context.request.body;
  // Non-email registration method
  if (!email) {
    return callback(null, user, context);
  }
  if (!email.endsWith("example.com")) {
    return callback(new Error("Access denied."));
  }
  return callback(null, user, context);
}

For more application scenarios and detailed documents, please see this.

Previous article: Add Custom Fields to IdToken Next article: Monitor Authentication Events with Webhook

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.