Skip to content

user object

The user object stores various data of the current user, as well as methods for adding custom fields and custom token fields.

INFO

The user object of the Pre-Register Pipeline contains the information filled in when the user registered, but it is not actually written to the database.

Only supports modifying user information (user object) in the Pipeline before and after authentication. It does not support directly modifying user information in the Pipeline at other nodes (such as before and after token issuance).

Attributes

Attribute nameValue typeDescription
idstringUser ID
usernamestringUser name
emailstringEmail
emailVerifiedbooleanEmail verified
phonestringPhone number
phoneVerifiedbooleanPhone number verified
photostringAvatar link
nicknamestringNickname
genderstringGender
lastLoginstringLast login time, in the format of 2020-02-07T04:29:40.877Z
companystringCompany name
browserstringRegistered browser
devicestringRegistered device
countrystringCountry
regionstringRegion
addressstringAddress

Methods

Method NameDescriptionSample Code
addCustomDataAdd user-defined fields. You need to define preset user-defined fields at the user pool level before you can set them for users in Pipeline.user.addCustomData("KEY", "VALUE")
addIdTokenSet custom fields for ID Token. It can also be used to replace the original ID Token content. **This interface is only available before OIDC ID Token is issued. **user.addIdToken("KEY","VALUE")
removeIdTokenDelete original or custom fields of ID Token. **This interface is only available before OIDC ID Token is issued. **user.removeIdToken("KEY","VALUE")
addAccessTokenSet custom fields for Access Token. It can also be used to replace the original Access Token content. **This interface is only available before OIDC Access Token is issued. **user.addAccessToken("KEY","VALUE")
removeAccessTokenDelete the original or custom fields of Access Token. **This interface is only available before OIDC Access Token is issued. **user.removeAccessToken("KEY")

Agent infrastructure for identity, memory, and web action.