¶ Certification in a small program
In the applet, in addition to obtaining, modifying user information, mailbox mobile phone number login, adding user custom fields, etc., you can also use the applet environment uniqueGet the user's mobile phone number through WeChat、 Use WeChat Authorized Login、Log in with the mobile phone number authorized by WeChat methods.
¶ In Authing configuring a small program login
In order to use in a small program Authing Applets SDK, you need to be in WeChat open platform (opens new window) apply for a small program while Authing console (opens new window) Fill in the configuration of the applet.
For details, please see:In Authing configuring a small program login.
¶ Introduce Authing Applets SDK
For detailed installation processes, see:Install a small program SDK.
First step first initialization AuthenticationClient
, initialization requires incomingAppId
(application ID):
You can be on the console application view your own application list.
const { AuthenticationClient } = require('authing-wxapp-sdk')
const authing = new AuthenticationClient({
appId: 'AUTHING_APP_ID',
})
You can use it next AuthenticationClient
method, such as Use WeChat Authorized Login:
const { code } = await wx.login()
const data = await authing.loginByCode(code)
- If the user logs in in a small program, and the user does not use the WeChat app log in to the same body to bind the same body, a new account will be created.
- If the user logs in in the applet in the applet, the user uses the WeChat app log in to the same body to bind the same body, and will return the corresponding WeChat account.
For details, please see:Applets SDK.