Huanxin IM Development Research

October 22, 2019 09:34:48

Official website address

Huanxin official website address

Development document address

Instant messaging cloud development document address

server integration

  • At present, the project already has a user group, and needs to integrate its own user group with Huanxin. That is to say, it is necessary to create a Huanxin account for each app user. Creating a Huanxin account requires the following information: Huanxin’s username can
    Information required to create a Huanxin account
    be The primarykey of the current project user group.
  • When users log in to the software, they need to log in to Huanxin at the same time.

Integrate the existing users of the online APP into Huanxin user management REST API provides a REST method to create Huanxin account. This method is very simple. You only need to provide two parameters: account ID and password, and you can create a Huanxin account. For an APP that is already online and has many existing users, to integrate Huanxin, you only need to write a script to call the REST method for creating Huanxin users in a loop. The username in the Huanxin account can be the same as the primarykey of the user in the existing APP user system. The advantage of this is that there is no need to make any changes to the user table of the existing APP background database (for example, there is no need to add a field called Huanxin account ID to the user table).

To ensure security, the APP creates a Huanxin account when creating a new user. It is strongly recommended to only call the REST method of creating a Huanxin account on the server side. For details, see User Management REST API. That is, every time when the APP client calls the APP's own business background to create a new user, a Huanxin account is also created for the APP user on Huanxin. The usual practice is to create a Huanxin account by calling the REST method of creating a Huanxin account after successfully creating a user in your APP. Because this method is a server-to-server call, there is little chance of failure due to network instability. However, developers still need to process the return result of this method. If this method fails, a retry should be made. If it still fails, the operation of creating a user in their APP should be rolled back. Otherwise, it will cause inconsistency between the APP user account and Huanxin account.

To ensure security, it is strongly recommended to only call the REST method of deleting the Huanxin account on the server side when the APP deletes the user. For details, see User Management REST API. That is, every time the APP client invokes the APP's own business background to delete a new user, the Huanxin account corresponding to the APP user is also deleted on Huanxin.

When the APP modifies the user password, update the password of the Huanxin account to ensure security. It is strongly recommended to only call the REST method of changing the Huanxin account password on the server side. For details, see User Management REST API. That is, every time when the APP user's password is changed, the corresponding Huanxin account password of the APP user should also be updated.

  • Request Huanxin's official interface to directly send a rest request. The official suggestion is to use Jersey to call Huanxin's api

Guess you like

Origin blog.csdn.net/javaXiaoAnRan/article/details/102676598