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

  • Authenticate the user

    • Use account password authentication
    • Use SMS verification code authentication
    • Use social login authentication
    • Use scan code login authentication

    • Certify in Mini Program
    • Implement single sign-on (SSO)
    • Single sign-on on the mobile terminal
    • Multi-factor authentication (MFA)

    • Extend the authentication process

      • Add user-defined fields
      • IdToken add custom field
      • Use a custom database to authenticate users
      • Use Pipeline to extend the authentication process
      • Use Webhook to monitor authentication events
    • Personalize the guard
  • 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

  • Audit Log

  • Configure security information

  • Configure user pool information

  • Deployment plan

  • Frequently Asked Questions FAQs

  1. Guides
  2. /
  3. Authenticate the user
  4. /
  5. Extend the authentication process
  6. /
  7. IdToken add custom field

¶ Add customize field with IdToken

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

¶ What is IdToken

id_token is equivalent to the user's ID. The developer's front-end should carry the id_token when accessing the back-end interface, and the developer server needs to verify the id_token passed by the front-end. You can use the key of the OIDC application or the public key of the OIDC application to verify the signature, and then you can get the user ID and basic information corresponding to this token. For sample code, please see::[Verify Token with Application Key.](/guides/basics/authenticate-first-user/how-to-validate-user-token.md#Use 应用密钥验证-hs256-算法签名的-token)

In Authing, the token field of user information is an IdToken.

¶ Default IdToken fields

An OIDC IdToken contains the following fields by default, refer to the OIDC Specification (opens new window):

FieldsDescription
subUnique id
nameUser name
given_nameGiven name
family_nameFamily name
middle_nameMiddle name
nicknameDisplay name
preferred_usernamePreferred usrname
profileUser profile
pictureProfile image
websiteWebsite link
emailEmail
email_verifiedIf email has been verified
genderGender
birthdateDate of birth
zoneinfoTimezone
localeZone
phone_numberPhone number
phone_number_verifiedVerified phone number
addressAddress
formattedDetailed address
street_addressStreet
localityStreet address
regionState
postal_codeZip code
countryCountry
updated_atUpdate time

¶ IdToken add customize fields

You can use Authing's Pipeline Capabilityto insert custom code snippets in the user authentication process and add custom IdToken fields to users. For example, in the following example, we have added the KEY field to the user's id_token with a value of VALUE:

async function pipe(user, context, callback) {
  user.addToken("KEY", "VALUE");
  callback(null, user, context);
}

You can parse id_token on this website (opens new window).

Prev: Add user-defined fields Next: Use a custom database to authenticate users
  • What is IdToken
  • Default IdToken fields
  • IdToken add customize fields

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.