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

  • 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

    • Pipeline

      • Create Your First Pipeline Function
      • Pipeline API Reference
      • Pipeline Use Cases
      • Pipeline User Object
      • Pipeline Context Object
      • Use Environment Variables in Pipeline
      • Available Node Modules
      • How to Debug
      • Private Deployment
    • Webhooks
  • Audit Logs

  • Setting

  • FAQ

  1. User Guide
  2. /
  3. Automation
  4. /
  5. Pipeline
  6. /
  7. Pipeline Context Object

¶ context object

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

The context object stores the context of the current authentication process, including authentication methods, identity provider, and request IP, address, etc.

¶ Attributes

Attribute nameTypeDescription
protocolstringAuthentication protocol. See below for details.
connectionstringIdentity provider. See below for details.
userPoolIdstringUser pool ID
userPoolNamestringUser pool name
userPoolMetadataobjectUser pool configuration
appIdstringCurrent user ID
appNamestringCurrent application name
appMetadataobjectCurrent application configuration information
requestobjectDetailed information of the current request, including:
ip: Client IP
geo: Client geographic location resolved by IP
body: Request body
query: Query string object, you can get the corresponding query parameter through request.query.xxx
accessTokenTargetEnum: programmaticAccount, userOnly has a value in the pipeline before issuing accessToken, indicating whether the current accessToken is issued for programmatic access account or user

¶ protocol

Authentication protocol.

Possible values ​​Description
passwordAuthentication method based on account and password
smsAuthentication method based on SMS verification code
socialSocial login authentication by default, this value is used when logging in using the social login method integrated with GenAuth.
ldapUse LDAP for authentication. For information about how to connect to LDAP, see Configure LDAP Service.
samlUse SAML for authentication. For information about how to connect to SAML, see Connect to SAML.
oidcUse OIDC protocol for authentication. For information about how to connect to OIDC, see Use OIDC Authorization.

¶ connection

Identity provider.

Possible valuesDescription
ldapLogin using the LDAP protocol. A GenAuth LDAP service corresponds to a GenAuth user directory or a third-party user directory. For details, see Configuring LDAP Services and Using an LDAP User Directory with GenAuth.
samlUse SAML protocol to log in. For how to connect to SAML, see Connect to SAML.
oidcUse OIDC protocol authentication. For how to connect to OIDC, see Use OIDC authorization.
githubLog in with GitHub. For details, see Log in to GitHub.

wechat

Log in by scanning the QR code on PC WeChat. For details, see Log in by scanning the QR code on PC WeChat.
wechat:miniprogramLog in using WeChat Mini Program. For details, see Log in by scanning the QR code on PC WeChat.
wechatworkLog in with WeChat for Business.
qqLog in with QQ web version. For details, see Log in with QQ.
weiboLog in with Weibo web version. For details, see Log in with Weibo.
dingtalkLog in using the DingTalk web version. For details, see Log in using DingTalk.
alipayLog in using the Alipay APP. For details, see Log in using the mobile APP Alipay .

¶ data object

¶ Before and after registration

Some request fields of the data object in the Pipeline before and after registration are as follows: For details, please see GenAuth GraphQL Debugger (opens new window) User Authentication - Registration interface.

Fields such as email, phone, unionid may not exist at the same time. Please check whether they exist before using them! Such as

const email = context.request.body.email;
if (email) {
  // Indicates that the registration is done by email
  // Logic for whitelisting email registration

  if (!email.endsWith("example.com")) {
    return callback(new Error("Access Denied!"));
  }
}
Field nameTypeMust existDescription
usernamestringNoUsername, not empty when registering with username.
emailstringNoEmail, not empty when registering with username.
phonestringNoMobile number, not empty when registering with mobile number.
forceLoginbooleannoWhether to automatically perform the login process when registering, the default is false
profileobjectyesUser information filled in by the user when registering

¶ Before authentication, after authentication

The request fields of the data object in the pipeline before and after authentication are as follows:

These fields may not all exist, please determine whether they exist before using them!

Field nameTypeMust existDescription
usernamestringnoUsername, not empty when logging in with username.
emailstringnoEmail, not empty when logging in with email.
phonestringnoMobile number, not empty when logging in with mobile number.

¶ userPool object

User pool related information

Field nameTypeDescription
idstringUser pool ID
namestringUser pool name

¶ geo attribute

Sample data:

{
  "province": "Beijing",
  "city": "Beijing",
  "adcode": "110000",
  "rectangle": "116.0119343,39.66127144;116.7829835,40.2164962"
}
Previous article: Pipeline User Object Next article: Use Environment Variables in Pipeline
  • Attributes
  • protocol
  • connection
  • data object
  • userPool object
  • geo attribute

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.