Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:comet:authentication [2017/09/01 07:19]
levhav
en:comet:authentication [2019/12/18 02:05] (current)
Line 4: Line 4:
 ====== Users’ authorization on the comet-server ====== ====== Users’ authorization on the comet-server ======
  
-Besides of channels where each user, who know channel’s ​name, can subscribe it, here is an opportunity to authorize users on the comet-server and send private messages to users by their IDs.  User authorization involved several steps. The first step – it is sending user’s ID and a random hash in your system to the comet-server.+Besides of channels where each user, who know name of channel, can subscribe it, here is an opportunity to authorize users on the comet-server and to send private messages to users by their IDs.  User authorization involved several steps. The first step – it is sending user’s ID and a random hash in your system to the comet-server.
  
 <code sql> <code sql>
Line 25: Line 25:
 While messages from authorized users are sending by its ID ([[en:​comet:​cometql|insert query to table users_messages]]),​ messages is sending to all user’s devices (up to 16), where he is authorizing at this moment. It’s very convenient when some user has visited your site and has authorized here by more than one device. While messages from authorized users are sending by its ID ([[en:​comet:​cometql|insert query to table users_messages]]),​ messages is sending to all user’s devices (up to 16), where he is authorizing at this moment. It’s very convenient when some user has visited your site and has authorized here by more than one device.
   ​   ​
-If some user at that moment is offline, ​than sent message is placed into a queue of messages and would be delivered when it user will be online.+If some user at that moment is offline, ​then sent message is placed into a queue of messages and would be delivered when it user will be online.
  
-The main purpose of mentioned queue is delivering messages after a short-term user’s offline. For example, in those cases when user is updating some site’s ​page where was opened a connection, and this user goes offline approximately for one second.+The main purpose of mentioned queue is delivering messages after a short-term user’s offline. For example, in those cases when user is updating some page in site where was opened a connection, and this user goes offline approximately for one second.
  
 ====== The subscription to receiving private messages ====== ====== The subscription to receiving private messages ======
Line 51: Line 51:
 These functions will be called when authorization status will be changing. I.e. at least once an authorization will be successful or unsuccessful when connecting to comet server or while status will be changed. ​ These functions will be called when authorization status will be changing. I.e. at least once an authorization will be successful or unsuccessful when connecting to comet server or while status will be changed. ​
  
-Also you can call the function “isAuthorized” to determine authorization status.+Alsoyou can call the function “isAuthorized” to determine authorization status.
 <code JavaScript>​cometApi.isAuthorized()</​code>​ <code JavaScript>​cometApi.isAuthorized()</​code>​
 The function “isAuthorized” may return 3 different values: ​ The function “isAuthorized” may return 3 different values: ​