CN111092904B - Network connection method and device - Google Patents
Network connection method and device Download PDFInfo
- Publication number
- CN111092904B CN111092904B CN201911374730.7A CN201911374730A CN111092904B CN 111092904 B CN111092904 B CN 111092904B CN 201911374730 A CN201911374730 A CN 201911374730A CN 111092904 B CN111092904 B CN 111092904B
- Authority
- CN
- China
- Prior art keywords
- authentication
- browser
- connection
- message
- authentication server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application provides a network connection method and device. The network connection method is applied to the client and comprises the following steps: when the local browser determines that authentication reconnection is needed, acquiring stored authentication information through the browser; and constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed. According to the authentication method and the authentication server, when the fact that authentication reconnection is needed is determined through a local browser, the authentication message does not need to be sent to the authentication server again through manual authentication information input by a user, the stored authentication information is directly obtained through the browser to construct the authentication message, the authentication message is sent to the authentication server to complete authentication, and the authentication reconnection without perception of the user is achieved.
Description
Technical Field
The present application relates to network communication technologies, and in particular, to a network connection method and apparatus.
Background
Portal authentication is a type of Web authentication. When a user accesses the internet through a browser, the user is forced to access a specific page, and at the moment, the user can only access the services and resources provided by the Portal page. When the user needs to access other resources in the Internet, the user must authenticate the Portal page, and the Internet resources can be accessed after the authentication is passed.
When the user is abnormally offline due to the fact that the user does not access other resources in the internet through the browser for a long time or due to factors such as network instability and the like, the user needs to manually authenticate through the browser so that the user can be online again. However, the manual authentication method is not only cumbersome to operate but also has poor user experience.
Disclosure of Invention
The application provides a network connection method and device.
The technical scheme provided by the application comprises the following steps:
according to a first aspect of the present application, there is provided a network connection method, applied to a client, including:
when the local browser determines that authentication reconnection is needed, acquiring stored authentication information through the browser; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser;
and constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed.
According to a second aspect of the present application, there is provided a network connection device, which is applied to a client, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring stored authentication information through a local browser when the browser determines that authentication reconnection is needed; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser;
and the connection unit is used for constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed.
According to the technical scheme, when the authentication reconnection is determined to be needed through the local browser, the authentication message does not need to be sent to the authentication server again through manual authentication information input by the user, the stored authentication information is directly obtained through the browser to construct the authentication message, the authentication message is sent to the authentication server to complete authentication, and the authentication reconnection without perception of the user is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a diagram of an application scenario provided by the present application;
FIG. 2 is a flow chart of a method provided herein;
FIG. 3 is a flowchart of an implementation of step 101 provided herein;
FIG. 4 is a flowchart of another implementation of step 101 provided herein;
FIG. 5 is a flowchart of an implementation of step 102 provided herein;
FIG. 6 is a flowchart of another implementation of step 102 provided herein;
fig. 7 is a flowchart of an embodiment provided herein.
FIG. 8 is a schematic diagram of the device structure provided in the present application;
fig. 9 is a schematic hardware structure diagram of the apparatus shown in fig. 8 provided in the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is an application scenario diagram of the network connection method provided in the present application. As shown in fig. 1, includes: the system comprises terminal equipment, access equipment, portal server and authentication server, wherein the terminal equipment is provided with a client and a browser. When a user accesses internet resources by using a client, a message for accessing the internet resources is received by the access equipment, and whether the user passes authentication is judged. If the authentication is not passed or not performed, the message is forwarded to a portal server, and the portal server returns an authentication page link to the client so that the client accesses the authentication page link through a browser to obtain an authentication page. The user can input authentication information on the authentication page and send the authentication information to the access equipment, the access equipment sends the authentication information to the authentication server, the authentication server authenticates the authentication information, and the user is on-line when the authentication is passed.
After the user is online, the user is abnormally offline because the user does not access other resources in the internet through a browser for a long time or because of factors such as network instability and the like. In order to avoid the tedious operation caused by the fact that a user needs to manually input authentication information to re-authenticate after being abnormally offline, the embodiment of the application provides a network connection method to achieve authentication reconnection under the condition that the user does not perceive.
Referring to fig. 2, fig. 2 is a flowchart of a network connection method according to an embodiment of the present disclosure. The network connection method can be applied to a client that can access resources in the internet through a browser.
As shown in fig. 2, the process may include the following steps:
step 101, when a local browser determines that authentication reconnection is needed, acquiring stored authentication information through the browser; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser;
as an example, the local browser may be a browser built in the client, or may be another browser installed on the terminal device where the client is located.
As one example, there are multiple implementations of determining, by a local browser, that authentication reconnects are required. One of which is shown in fig. 3 and will be described in detail below, and will not be described again here.
As one example, there are a number of implementations of stored authentication information. As one implementation manner, the stored authentication information may be acquired from an authentication packet obtained when the client detects that the browser constructs the authentication packet. As another implementation, the stored authentication information may also be authentication information obtained by means of a cookie. In specific implementation, a corresponding script file may be preset in the browser, and after it is determined that the browser has constructed the authentication message, the script may be executed to obtain the authentication information in the authentication message, and store the authentication information in a preset specified location. And meanwhile, generating a callback function for acquiring the authentication information at the specified position according to the specified position so as to execute when the subsequent browser needs to acquire the authentication information.
As one example, there are various implementations of obtaining stored authentication information through the browser. One of which is shown in fig. 4 and will be described in detail below, and will not be described again here.
And step 102, constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed.
As an example, after the authentication information is obtained through the browser, an authentication message may be constructed by the browser using the authentication information and sent to the authentication server. Since the authentication information is carried in the authentication message sent by the client to the authentication server through the browser, the authentication information is inevitably authenticated by the authentication server on the premise that the authentication process is not changed and the service link is not changed by the authentication service.
This completes the description of the embodiment shown in fig. 2.
According to the technical scheme, when the local browser determines that authentication reconnection is needed, the authentication message does not need to be sent to the authentication server again by manually inputting authentication information by a user, but the stored authentication information is directly acquired by the browser to construct the authentication message, and the authentication message is sent to the authentication server to complete authentication, so that the authentication reconnection without perception of the user is realized.
How to determine that the authentication reconnection is required through the local browser in step 101 will be described below with reference to the embodiment shown in fig. 3. As shown in fig. 3, the process includes:
step 1011, sending a keep-alive message to the authentication server according to the established websocket connection;
as an example, an established websocket connection is established after a previous authentication pass. Compared with http connection, websocket connection does not need to establish connection for each message once when the websocket connection sends the message. Therefore, a large number of connection establishment steps can be reduced by sending the keep-alive messages through the websocket connection, and a large number of equipment resources are saved.
Step 1012, when it is determined that the browser receives the reset connection message sent by the authentication server, it is determined that authentication reconnection is required.
As an example, the reset connection message is sent by the authentication server in response to the keep-alive message when the authentication server has closed the websocket connection but the browser has not closed the websocket connection. The authentication server closes the websocket connection, which means that the client has not transmitted the keep-alive message with the authentication server for a long time, so that the authentication server considers that the user is offline. However, the browser does not close the websocket connection, which means that the transmission of the keep-alive message with the authentication server for a long time is caused by other abnormal conditions, and therefore, when the reset connection message is received, it can be determined that authentication reconnection is needed.
As an example, when identifying whether the message is a reset connection message, the determination may be made according to a field carried in the message.
This completes the description of the embodiment shown in fig. 3.
According to the technical scheme, the websocket connection is long connection, so that in the process of sending the keep-alive messages to the authentication server through the websocket connection, the embodiment of the application can send the keep-alive messages by using the websocket connection only once by establishing the websocket connection.
After the authentication message carrying the authentication information is constructed by the browser and sent to the authentication server, if the port of the authentication service is changed, the authentication server is caused to always send the reset connection message to the browser. In order to avoid that the reconnection cannot be authenticated for a long time due to the above situation, the method performs the operation of acquiring the stored authentication information through the browser only when the number of the received reset connection messages is smaller than the message number threshold, which is described in detail below with reference to the flow shown in fig. 4:
step 1013, counting the number of the messages receiving the reset connection message in a unit time length to obtain a counting result;
as an example, the unit time length may be set in advance by the user, for example, to 3 seconds or 4 seconds or the like. The actual value of the unit time length is not specifically limited in the present application.
Step 1014, when the statistical result is smaller than a preset message quantity threshold value, acquiring the stored authentication information through the browser;
as an example, the message number threshold may be preset by the user, for example, set to 10 or 15, etc. The actual value of the message quantity threshold value is not specifically limited in the application.
As an example, if the statistical result is smaller than the preset message number threshold, it indicates that the number of times of attempting authentication reconnection is still within the normal range, and the browser still has a possibility of establishing a connection with the authentication server.
Step 1015, when the statistical result is greater than or equal to the preset message quantity threshold, outputting a prompt message, where the prompt message is used to indicate that the connection between the browser and the authentication server has been disconnected.
As an example, when the statistical result reaches the message number threshold, it indicates that the number of times of attempting authentication reconnection is enough, and the authentication reconnection can no longer be implemented, and at this time, it is no longer necessary to perform the acquisition of the stored authentication information by the browser.
As an example, after the operation of constructing the authentication packet carrying the authentication information by the browser and sending the authentication packet to the authentication server is stopped, a prompt message may be displayed on the client or the browser interface to remind a user corresponding to the client that the user needs to manually access the internet resource, the authentication information is manually sent to the authentication server through the authentication page to obtain a modified port of the authentication server, and the network connection method of the present application is continuously executed.
This completes the description of the embodiment shown in fig. 4.
Two implementation manners of performing offline detection on a user corresponding to the client according to websocket connection are respectively described below with reference to two embodiments shown in fig. 5 and fig. 6.
The following description will be made of the flow shown in fig. 5, which includes:
step 1021, sending an offline request to an authentication server through the browser by utilizing websocket connection;
as an example, when the user wishes to actively go offline, an offline request may be sent to the authentication server through the browser by using the websocket connection, so as to request the authentication server to take the user corresponding to the client offline.
Step 1022, if it is determined that the browser receives the successful offline message sent by the authentication server through the websocket connection, it is determined that the user corresponding to the client is actively offline.
As an example, if the authentication server receives the offline request and successfully takes the user corresponding to the client offline, the authentication server sends a successful offline message to the browser and closes the websocket connection. Therefore, if it is determined that the browser receives the offline message successfully through the websocket connection, it indicates that the user corresponding to the client is actively offline.
As an example, when it is determined that the user corresponding to the client is actively offline, since message interaction with the authentication server is no longer required, the websocket connection may be closed.
This completes the description of the embodiment shown in fig. 5.
Next, another implementation manner for performing offline detection on a user corresponding to the client according to websocket connection is described with reference to the flow shown in fig. 6.
As shown in fig. 6, the process may include:
step 1023, sending a keep-alive message to an authentication server by the browser through websocket connection;
as an example, keep-alive messages may be periodically sent to the authentication server, and whether the user corresponding to the client is offline is detected.
Step 1024, if it is determined that the browser receives the reset connection message sent by the authentication server, it is determined that the user corresponding to the client is abnormally offline.
As an example, the reset connection message is sent by the authentication server in response to the keep-alive message when the authentication server has closed the websocket connection but the browser has not closed the websocket connection. The authentication server closes the websocket connection, which means that the client has not transmitted the keep-alive message with the authentication server for a long time, so that the authentication server considers that the user is offline. However, since the browser does not close the websocket connection, this means that the transmission of the keep-alive message with the authentication server for a long time is caused by other abnormal conditions, and therefore, when it is determined that the browser receives the reset connection message, it can be determined that the user is abnormally offline.
This completes the description of the embodiment shown in fig. 6.
Besides the two implementation manners of performing offline detection on the user corresponding to the client shown in fig. 5 and fig. 6, the present application also provides another implementation manner:
if the browser is determined to receive the user offline message actively sent by the authentication server through the connection, determining that the user corresponding to the client side is passively offline;
as an example, if the server desires that the user corresponding to the client is offline, the server sends a user offline message to the browser to notify that the user corresponding to the client is offline.
Examples
The present application is described below in accordance with one of its embodiments. As shown in fig. 7, this embodiment includes the following flow:
step 10, when the browser establishes connection with the authentication server for the first time, the user manually inputs and stores authentication information; sending the authentication information to an authentication server through a browser, and establishing connection between the browser and the authentication server according to a websocket mode when the authentication is passed;
as an example, when the client accesses the internet resource through the browser, a message for accessing the internet resource is first sent to the access device. Because the user corresponding to the client does not complete authentication, the access device sends the message to the portal server, and the portal server returns an authentication page link to the client. When the client determines that the browser receives the authentication information input by the user on the authentication page, the authentication information is stored to the designated position for use in subsequent authentication reconnection. The browser sends an authentication message carrying the authentication information to an authentication server, and when the authentication is passed, the browser establishes connection with the authentication server according to a websocket mode.
Step 20, sending a keep-alive message to the authentication server according to the established websocket connection;
as an example, after establishing the websocket connection, the client periodically sends a keep-alive message to the authentication server through the browser, so that the user corresponding to the client maintains an online state.
Step 30, when determining that the browser receives the reset connection message sent by the authentication server, determining that authentication reconnection is needed; counting the number of the messages receiving the reset connection message in unit time length to obtain a counting result;
as an example, when the network environment of the client is poor, the keep-alive message cannot be sent to the authentication server, and the authentication server goes off-line with the user corresponding to the client. When the network environment of the client side is recovered to be normal, the keep-alive message can be successfully sent to the authentication server. However, since the authentication server has taken the user corresponding to the client offline and correspondingly closed the websocket connection on the authentication server side, the authentication server may send a reset connection packet to the browser after receiving the keep-alive packet. Once the browser receives the reset connection message, the number of messages receiving the reset connection message in unit time length is counted, and the counted result is increased by 1 when each reset connection message is received.
Step 40, judging whether the statistical result is larger than a preset message quantity threshold value or not; if the value is less than the predetermined value, the process goes to step 50, and if the value is greater than or equal to the predetermined value, the process goes to step 60.
As an example, it may be determined whether the statistical result is greater than a preset message quantity threshold value in real time.
Step 50, obtaining stored authentication information through the browser; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser; constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed; and carrying out off-line detection on the user corresponding to the client according to the connection.
As an example, after establishing a websocket connection between a browser and an authentication server, a keep-alive message may be sent to the authentication server by using the websocket connection, so as to detect whether a user corresponding to the client is abnormally offline.
And step 60, outputting prompt information, wherein the prompt information is used for indicating that the connection between the browser and the authentication server is disconnected.
As an example, a prompt message may be displayed on a client or a browser interface to remind a user corresponding to the client that the user needs to manually access internet resources, and the authentication information is manually sent to the authentication server through the authentication page to obtain a port modified by the authentication server, so as to continue to execute the network connection method of the present application.
The above is a description of the embodiment shown in fig. 7.
Corresponding to the embodiment of the network connection method, the application also provides an embodiment of the network connection device.
The embodiment of the network connection device can be applied to network equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the network device where the software implementation is located as a logical means. From a hardware aspect, as shown in fig. 7, the present application is a hardware structure diagram of a network device where a network connection apparatus is located, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 7, the network device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the network device, which is not described again.
Please refer to fig. 8, fig. 8 is a structural diagram of the apparatus provided in the present application. The device is applied to the client and comprises:
an obtaining unit 810, configured to obtain, by a local browser, stored authentication information when it is determined that authentication reconnection is required through the browser; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser;
a connection unit 820, configured to construct, by using the browser, an authentication packet carrying the authentication information and send the authentication packet to the authentication server, so that when the authentication is passed, a connection between the browser and the authentication server is established in a websocket manner, and an offline detection is performed on a user corresponding to the client according to the connection.
As an example, the obtaining unit 810 is specifically configured to send a keep-alive packet to the authentication server according to the established websocket connection; and when the browser is determined to receive the reset connection message sent by the authentication server, determining that authentication reconnection is needed.
As an example, the apparatus further comprises: and the detection unit (not shown in the figure) is used for performing offline detection on the user corresponding to the client according to the connection after the connection between the browser and the authentication server is reestablished according to the websocket mode.
As an example, the detection unit is specifically configured to: if the browser is determined to receive the user offline message actively sent by the authentication server through the connection, determining that the user corresponding to the client side is passively offline; if the browser is determined to receive the reset connection message sent by the authentication server, determining that the user corresponding to the client is abnormally offline; the reset connection message is sent by the authentication server in response to a keep-alive message sent by the browser through the connection; if the browser is determined to receive a successful offline message sent by the authentication server through the connection, determining that a user corresponding to the client is actively offline; the successful offline message is sent by the authentication server in response to an offline request sent by the browser through the connection.
As an example, the obtaining unit 810 is specifically configured to, when it is determined that the browser receives a reset connection message sent by the authentication server, count the number of messages received in a unit time length of the reset connection message, and obtain a statistical result; and when the statistical result reaches a preset message quantity threshold value, stopping executing the operation of constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server.
As an example, the apparatus further comprises: and a storage unit (not shown in the figure) for storing the authentication information to a specified position of the client when the browser is determined to obtain the authentication information.
This completes the description of the apparatus shown in fig. 8.
Referring to fig. 9, fig. 9 is a hardware structure diagram of a network device in which a network connection device according to the present application is located, where the hardware structure includes: a processor and a memory.
Wherein the memory is to store machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored in the memory to implement the network connection method shown in fig. 2.
For one embodiment, the memory may be any electronic, magnetic, optical, or other physical storage device that may contain or store information such as executable instructions, data, and the like. For example, the memory may be: volatile memory, non-volatile memory, or similar storage media. In particular, the Memory may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
So far, the description of the apparatus shown in fig. 9 is completed.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims (8)
1. A network connection method is applied to a client and comprises the following steps:
when the local browser determines that authentication reconnection is needed, acquiring stored authentication information through the browser; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser;
constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed;
wherein the determining, by the local browser, that authentication reconnection is required includes:
sending a keep-alive message to the authentication server according to the established websocket connection;
when the browser is determined to receive the reset connection message sent by the authentication server, the browser is determined to need authentication reconnection; the reset connection message is sent when the authentication server closes the websocket connection and the browser does not close the websocket connection.
2. The method of claim 1, wherein the obtaining stored authentication information via the browser comprises:
counting the number of the messages receiving the reset connection message in unit time length to obtain a counting result;
and when the statistical result is smaller than a preset message quantity threshold value, acquiring the stored authentication information through the browser.
3. The method of claim 1, wherein after reestablishing the connection between the browser and the authentication server in a websocket manner, the method further comprises: and carrying out off-line detection on the user corresponding to the client according to the connection.
4. The method according to claim 3, wherein the offline detecting the user corresponding to the client according to the connection comprises:
if the browser is determined to receive the user offline message actively sent by the authentication server through the connection, determining that the user corresponding to the client side is passively offline;
if the browser is determined to receive the reset connection message sent by the authentication server, determining that the user corresponding to the client is abnormally offline; the reset connection message is sent by the authentication server in response to a keep-alive message sent by the browser through the connection;
if the browser is determined to receive a successful offline message sent by the authentication server through the connection, determining that a user corresponding to the client is actively offline; the successful offline message is sent by the authentication server in response to an offline request sent by the browser through the connection.
5. A network connection device applied to a client comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring stored authentication information through a local browser when the browser determines that authentication reconnection is needed; the authentication information is carried in an authentication message sent to an authentication server by the client through the browser;
the connection unit is used for constructing an authentication message carrying the authentication information through the browser and sending the authentication message to the authentication server so as to establish connection between the browser and the authentication server according to a websocket mode when the authentication is passed;
the acquisition unit is specifically configured to send a keep-alive message to the authentication server according to the established websocket connection; when the browser is determined to receive the reset connection message sent by the authentication server, the browser is determined to need authentication reconnection; the reset connection message is sent when the authentication server closes the websocket connection and the browser does not close the websocket connection.
6. The apparatus of claim 5, further comprising:
and the detection unit is used for carrying out off-line detection on the user corresponding to the client according to the connection after the connection between the browser and the authentication server is reestablished according to the websocket mode.
7. A network device, characterized in that the network device comprises: a processor and a machine-readable storage medium;
the machine-readable storage medium to store machine-executable instructions;
the processor is used for reading and executing machine executable instructions stored in a machine readable storage medium to realize the network connection method according to any one of claims 1 to 4.
8. A machine-readable storage medium having stored therein machine-executable instructions for reading and execution by a processor to implement the network connection method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911374730.7A CN111092904B (en) | 2019-12-27 | 2019-12-27 | Network connection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911374730.7A CN111092904B (en) | 2019-12-27 | 2019-12-27 | Network connection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111092904A CN111092904A (en) | 2020-05-01 |
CN111092904B true CN111092904B (en) | 2022-04-26 |
Family
ID=70398431
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911374730.7A Active CN111092904B (en) | 2019-12-27 | 2019-12-27 | Network connection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111092904B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112511556B (en) * | 2020-12-16 | 2023-04-07 | 杭州迪普科技股份有限公司 | User authentication state monitoring method, device and system |
CN112751844B (en) * | 2020-12-28 | 2022-11-01 | 杭州迪普科技股份有限公司 | Portal authentication method and device and electronic equipment |
CN112968963B (en) * | 2021-02-23 | 2023-03-24 | 上海昊沧系统控制技术有限责任公司 | WebSocket-based method for forced real-time offline of user |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105959827A (en) * | 2016-04-22 | 2016-09-21 | 深圳市茁壮网络股份有限公司 | Data interaction method, set top box, and front-end server |
CN106656911A (en) * | 2015-10-29 | 2017-05-10 | 华为技术有限公司 | Portal authentication method, access device and management server |
CN106850502A (en) * | 2015-12-04 | 2017-06-13 | 阿里巴巴集团控股有限公司 | Service request retransmission method, storage method, apparatus and system based on connection long |
CN108134713A (en) * | 2017-12-19 | 2018-06-08 | 新华三技术有限公司 | A kind of communication means and device |
CN108259457A (en) * | 2017-09-27 | 2018-07-06 | 新华三技术有限公司 | A kind of WEB authentication methods and device |
CN109768965A (en) * | 2018-12-14 | 2019-05-17 | 广州华多网络科技有限公司 | A kind of login method of server, equipment and storage device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109274634B (en) * | 2017-07-18 | 2021-06-11 | 腾讯科技(深圳)有限公司 | Multimedia communication method and device, and storage medium |
-
2019
- 2019-12-27 CN CN201911374730.7A patent/CN111092904B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106656911A (en) * | 2015-10-29 | 2017-05-10 | 华为技术有限公司 | Portal authentication method, access device and management server |
CN106850502A (en) * | 2015-12-04 | 2017-06-13 | 阿里巴巴集团控股有限公司 | Service request retransmission method, storage method, apparatus and system based on connection long |
CN105959827A (en) * | 2016-04-22 | 2016-09-21 | 深圳市茁壮网络股份有限公司 | Data interaction method, set top box, and front-end server |
CN108259457A (en) * | 2017-09-27 | 2018-07-06 | 新华三技术有限公司 | A kind of WEB authentication methods and device |
CN108134713A (en) * | 2017-12-19 | 2018-06-08 | 新华三技术有限公司 | A kind of communication means and device |
CN109768965A (en) * | 2018-12-14 | 2019-05-17 | 广州华多网络科技有限公司 | A kind of login method of server, equipment and storage device |
Also Published As
Publication number | Publication date |
---|---|
CN111092904A (en) | 2020-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3013086B1 (en) | Method, apparatus and electronic device for connection management | |
CN111092904B (en) | Network connection method and device | |
EP3248128B1 (en) | Methods and computer storage medium for session security splitting | |
US8826402B2 (en) | Management of an instant message session | |
CN108632213B (en) | Equipment information processing method and device | |
CN107040494B (en) | User account abnormity prevention method and system | |
CN104580406B (en) | A kind of method and apparatus of synchronous logging state | |
CN106302308B (en) | Trust login method and device | |
EP3413255A1 (en) | Electronic payment service processing method and device, and electronic payment method and device | |
CN109698809B (en) | Method and device for identifying abnormal login of account | |
WO2015024447A1 (en) | Methods and systems for secure internet access and services | |
US9787678B2 (en) | Multifactor authentication for mail server access | |
CN113157466A (en) | Message pushing method, device, system, electronic equipment and storage medium | |
US11431699B2 (en) | Method and device for processing user operation | |
EP2627057A1 (en) | Time-out control method, device and system | |
CN110381043B (en) | SSL-based server health detection method and device and electronic equipment | |
CN107634850B (en) | A kind of application state acquisition methods and its equipment, storage medium, server | |
CN108924159B (en) | Verification method and device of message feature recognition library | |
CN104837134B (en) | A kind of web authentication user login method, equipment and system | |
CN111756840B (en) | Message pushing method and device | |
CN111241523B (en) | Authentication processing method, device, equipment and storage medium | |
WO2017080328A1 (en) | Terminal user state acquisition method, device and system | |
US10412778B2 (en) | Data transmission method and apparatus for data service | |
CN105338525A (en) | Login access processing method, apparatus and system | |
CN109688109A (en) | The verification method and device of identifying code based on client-side information identification |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |