Support ring channel integrated user web client system

Ready to work

1. Click to view related documents directly:

2. Customer account (administrator account)

3. A blank HTML page

  • If you do not know how to write can jump directly here

4. Install Local Server

  • Local installation of NPM , the direct input terminal npm install -g http-server, and then can be run directly at the root level http-server, resulting in a browser address to open, can be local test
  • Local install WampServer , according to documents directly installed after the completion of startup files to the www directory, you can directly access directly in the browser localhost

Integration

  1. After the successful landing customer account, switch to an administrator mode - Channel Management - the phone app to quickly create an association, there will be information appkey, client_id, client_secret, IM and other services for the registered account number
    Write pictures described here
    to obtain appkey DNS list , you can use this link:
    HTTP : //rs.easemob.com/easemob/server.xml app_key = orgName% 23appName?
  2. In the channel management - web pages, add a plug-in
    Write pictures described here
    or will directly use the default plug-ins, and then specify the associated plug-in directly and save
    Write pictures described here
  3. Integrated systems require users registered IM account , you can use the code simulation httpclient request, you can use google plug Postman , mac terminal registration, get a username and password
    Write pictures described here
  4. Open a blank HTML, then the page web user channels integrated system will copy the code directly into HTML
    Write pictures described here
    and then open the terminal, enter http-server, and then copy the return address to open the browser
    Write pictures described here
    to locate the file click
    Write pictures described here
  5. It says that username / password authentication, where the said username / token verification, according to the document acquired administrator token , the get token acquired url, then in accordance with the request body document body:
{
	"grant_type":"client_credentials",
	"client_id":"YXA6wDs-MARqEeSO0VcBzaqg11",
	"client_secret":"YXA6JOMWlLap_YbI_ucz77j-4-mI0dd"
}

Change

{
	"grant_type":"password",
	"username":"easemobtest",
	"password":"123456"
}

Get user token to go
Write pictures described here
get token to the user, to go to user authentication parameters

user: {            
   username: 'easemobtest',   
   token: 'YWMt-TPQqrKDEeinFVc2g1Rqh2oLp-DVnRHnnosL3QeejzZrpVGqsn4R6K8Dg-6-Fz8WAwMAAAFls3QCgBPGgAd-QhpC1ZW-3nH8sMbnTWLgV6cl9csFRPxeANB8u9lBg'      
}

Guess you like

Origin blog.csdn.net/qq_43128835/article/details/82504078