my.getAuthCode

Get authentication code.

Sample Code

copy
my.getAuthCode({
  scopes: 'auth_user',
  success: (res) => {
    my.alert({
      content: res.authCode,
    });
  },
});

Parameters

NameTypeMandatoryDescription
scopesString/ArrayNThe scope of auth, there are two types: auth_base
auth_user, by default, its value is auth_base

Success Callback Function

The incoming parameter is of the Object type with the following attributes:

FieldTypeMandatoryDescription
authCodeStringYAuth code
authErrorScopesKey-valueYThe scope that failed to grant auth, key is the scope and value is the error
authSuccessScopesArrayYThe scope that succeed to grant auth

Supported Auth Scopes

Precautions

  • The auth scopes are case sensitive.
  • The Silent field means whether you need to get the user consent (show permission page) or not.
  • The Preassign field means whether the scope is assigned by default to the merchant without needing to apply to business before using.

Check the data model for more details.

ScopeSilentPreassignData Points
auth_base / BASE_USER_INFOYesYes• Wallet Account ID
auth_user / USER_INFONoYes• Registered Name
• Registered Mobile Number
• Registered Email Address
USER_NAMENoNo• Profile Name
USER_AVATARNoNo• Profile Picture
USER_GENDERNoNo

• Gender

TNGD does not save Gender as mandatory field. Partners advised to derive Gender from NRIC number

USER_BIRTHDAYNoNo• Date of Birthday
USER_NATIONALITYNoNo• Nationality
USER_CONTACTINFONoNo• Verified Mobile Number
• Profile Email Address

USER_ADDRESS

No

No

• Address

USER_INFO_EKYCNoNo• Verified Name
• ID Type
• ID Number
• Nationality
• Address
• Date of Birth
• Occupation
• Nature of Business