Authing DocsDocuments
Concept
workflow
Guides
Development Integration
Application integration
Concept
workflow
Guides
Development Integration
Application integration
Old Version
Guides
  • Quick start

  • Authenticate the user

  • Authority management for users

  • Authorization

  • Manage user accounts

  • Manage User Directory

  • Management Application

  • Become a source of federal authentication identity

  • Connect to an external identity provider (IdP)

  • Open up WeChat ecology
  • Migrate users to Authing

  • Management organization

  • Expandable capabilities

    • Use Webhook to monitor user events
    • Custom authentication process (Pipeline)

      • Create your first Pipeline function
      • Pipeline API Reference
      • Pipeline application scenario
      • Pipeline User Object
      • Pipeline Context Object
      • Use environment variables in Pipeline
      • Available Node Modules
      • How to debug
      • FAQ
      • Private deployment
  • Audit Log

  • Configure security information

  • Configure user pool information

  • Deployment plan

  • Frequently Asked Questions FAQs

  1. Guides
  2. /
  3. Expandable capabilities
  4. /
  5. Custom authentication process (Pipeline)
  6. /
  7. Pipeline Context Object

¶ Context Object

Update Time: 2025-02-18 09:00:47
Edit

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

¶ Attributes

Attribute nameTypeDescription
protocolstringAuthentication protocol. See below for specific instructions.
connectionstringIdentity provider. See below for specific instructions.
userPoolIdstringUser pool ID
userPoolNamestringUser pool name
userPoolMetadataobjectUser pool configuration
appIdstringID of the current user
appNamestringThe name of the current application
appMetadataobjectConfiguration information of the current application
requestobjectDetails of the current request, including:
ip: Client IP
geo: The geographical location of the client resolved by IP
body: request body
query: query string object,you can get the corresponding query parameters through request.query.xxx

¶ protocol

Authentication protocol.

Possible valueDescription
passwordAuthentication method based on account password
smsAuthentication method based on SMS verification code
socialThe social login authentication default value when logging in with the Authing integrated social login method.
ldapUse LDAP for authentication. For how to access LDAP, please refer to Configuring LDAP Service。
samlUse SAML for authentication. For how to access SAML, please refer to Access SAML。
oidcUse OIDC protocol for authentication. For how to access OIDC, please refer to Using OIDC Authorization。

¶ connection

Identity provider.

Possible valueDescription
ldapUse lDAP protocol to log in. An Authing LDAP service corresponds to an Authing user directory or a third-party user directory. For details, refer to Configuring LDAP Service and Using Authing LDAP User Directory.
samlLog in using the SAML protocol. For how to access SAML, refer to Accessing SAML.
oidcUse OIDC protocol authentication. For information on how to access OIDC, please refer to Using OIDC Authorization.
githubLog in with GitHub. For details, refer to Access GitHub Login.
## data object

¶ Before and after registration

Before and after registration, the requested fields of the data object in the Pipeline are as follows: For details, refer to Authing GraphQL Debugger (opens new window) User Authentication - RegistrationInterface.

email, phone, unionid and other fields may not exist at the same time, please check whether they exist before using them. For example:

const email = context.request.body.email;
if (email) {
  // 表示是用邮箱注册
  // 可以进行邮箱注册白名单的逻辑

  if (!email.endsWith("example.com")) {
    return callback(new Error("Access Denied!"));
  }
}
Field NameTypeExistDescription
usernamestringNoUser name. It is not empty when registering with the user name
emailstringNoEmail address. It is not empty when registering with the user name
phonestringNoMobile phone number. It is not empty when using the mobile phone number to register
forceLoginbooleanNoWhether to automatically perform the login process when registering, the default is false
profileobjectYesUser information filled in for user registration

¶ Before and 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 check whether they exist before using them.

Field NameTypeExistDescription
usernamestringNoUser name, which is not empty when logging in using user name.
emailstringNoEmail, which is not empty when logging in using email.
phonestringNoMobile phone number, which is not empty when logging in using mobile phone number.

¶ userPool object

Field NameTypeDescription
idstringUser pool ID
namestringUser pool name

¶ geo Attribute

Sample data:

{
  "province": "北京市",
  "city": "北京市",
  "adcode": "110000",
  "rectangle": "116.0119343,39.66127144;116.7829835,40.2164962"
}
Prev: Pipeline User Object Next: Use environment variables in Pipeline
  • Attributes
  • protocol
  • connection
  • userPool object
  • geo Attribute

User identity management

Integrated third-party login
Mobile phone number flash check (opens new window)
Universal login form component
Custom authentication process

Enterprise internal management

Single Sign On
Multi-factor Authentication
Authority Management

Developers

Development Document
Framework Integration
Blog (opens new window)
GitHub (opens new window)
Community User Center (opens new window)

Company

400 888 2106
sales@authing.cn
16 / F, Block B, NORTH STAR CENTURY CENTER, Beijing(Total)
room 406, 4th floor, zone B, building 1, No. 200, Tianfu Fifth Street, Chengdu(branch)

Beijing ICP No.19051205-1

© Beijing Steamory Technology Co.