Login method, device, equipment and storage medium based on open authorization protocol
By receiving the client's login request in the OAuth2.0 login, handling the failure of page jump, generating switching instructions and determining the second client, the problem of page jump failed in OAuth2.0 login in different browsers is solved, and the login success rate and user experience are improved.
Patent Information
- Application Number
- CN202310281008.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-16
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2043-03-16
AI Technical Summary
The existing OAuth 2.0 login method has the problem of page redirection failure in different browsers, which leads to users need to manually switch browsers, which is inefficient and affects the user experience.
By receiving the login request from the first client, the page is redirected and the result is obtained. If the page redirect fails, obtain the page redirect configuration information, generate client switching instructions, determine the second client, and complete the login page redirection and authorized login through the second client.
It improves the success rate of login page jump, simplifies the process of client switching, and improves the convenience of login and user experience.
Smart Images

Figure CN116405268B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a login method, device, equipment and storage medium based on an open authorization protocol. Background Art
[0002] With the development and promotion of computer web applications and mobile terminal applications, people's production and life are full of various applications, and different applications involve multiple sets of user accounts and passwords. In order to realize the multi-use of user accounts and passwords, the login method of open authorization login (Open Authorization, referred to as OAuth2.0) came into being. OAuth2.0 uses tokens instead of user accounts and passwords to access applications. OAuth 2.0 enables third-party applications to log in by requesting user authorization from resource providers without obtaining user accounts and passwords. For example, when users visit browser websites to leave messages but do not want to register, they can directly use the account and password authorized by WeChat to complete the login. In addition, OAuth2.0 allows users to decide whether to allow third-party applications to access personal resources stored in the OAuth2.0 service provider. Therefore, the login method of OAuth2.0 is becoming more and more popular.
[0003] When OAuth2.0 is currently used for login authorization, it is necessary to request user authorization from the resource provider to log in by means of page jump. When the third-party login page jump fails, OAuth2.0 cannot be completed. The failure of the third-party login page jump may be caused by network problems, website restrictions, or browser configuration problems. In addition, the page jump process is inseparable from the browser of the terminal device. Different terminal devices use different browsers, which may cause the third-party login page jump to fail. For example, the browser may not support certain third-party logins, or the third-party login may have certain requirements for the browser's properties. At present, when a user finds that the browser fails to jump to the third-party login page, the user often needs to exit the current browser, manually select a different browser to switch, and open a new browser to log in again.
[0004] Therefore, the existing OAuth2.0 has the problem of page jump failure in different browsers, and the switching efficiency of manually switching browsers is low, which affects the user experience. Summary of the invention
[0005] Based on this, it is necessary to provide a login method, device, computer equipment and storage medium based on an open authorization protocol to address the above technical problems, so as to solve the problem that the third-party login page jump is prone to failure and the user experience is poor when logging in using the open authorization protocol.
[0006] A login method based on an open authorization protocol, comprising:
[0007] Receiving a first login request sent by a first client;
[0008] Performing a page jump according to the first login request, and obtaining a page jump result;
[0009] If the page jump result is a page jump failure, obtaining page jump configuration information, and generating a client switching instruction according to the page jump configuration information;
[0010] Acquire the candidate client configuration information of the plurality of candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the plurality of candidate clients;
[0011] A second login request sent by the second client is received, a page jump is performed according to the second login request, and an authorized login page of the second client is generated to complete the login through the authorized login page of the second client.
[0012] A login device based on an open authorization protocol, comprising:
[0013] A first login request receiving module, used to receive a first login request sent by a first client;
[0014] A page jump result acquisition module, used to perform a page jump according to the first login request and obtain a page jump result;
[0015] A client switching instruction generating module, used for obtaining page jump configuration information if the page jump result is a page jump failure, and generating a client switching instruction according to the page jump configuration information;
[0016] A second client determination module is used to obtain the candidate client configuration information of multiple candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the multiple candidate clients;
[0017] The second client login module is used to receive the second login request sent by the second client, perform page jump according to the second login request, and generate an authorized login page for the second client to complete the login through the authorized login page of the second client.
[0018] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the above-mentioned login method based on the open authorization protocol is implemented.
[0019] One or more readable storage media storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the above-mentioned login method based on the open authorization protocol.
[0020] The above-mentioned login method, device, equipment and storage medium based on the open authorization protocol, the method is through receiving a first login request sent by a first client; performing a page jump according to the first login request, and obtaining a page jump result; if the page jump result is a page jump failure, then obtaining page jump configuration information, and generating a client switching instruction according to the page jump configuration information; obtaining the selected client configuration information of multiple selected clients according to the client switching instruction, traversing the selected client configuration information according to the page jump configuration information, and determining a second client among multiple selected clients; receiving a second login request sent by a second client, performing a page jump according to the second login request, and generating an authorized login page of the second client, so as to complete the login through the authorized login page of the second client. After the login page jump of the first client fails, the present invention determines the second client according to the page jump configuration information, ensures the success rate of the login page jump, simplifies the process of client switching, and improves the convenience of login and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0022] Figure 1 It is a flow chart of a login method based on an open authorization protocol in one embodiment of the present invention;
[0023] Figure 2 It is a structural diagram of a login device based on an open authorization protocol in one embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In one embodiment, if Figure 1 As shown, a login method based on an open authorization protocol is provided, comprising the following steps S10-S50.
[0027] S10: Receive a first login request sent by a first client.
[0028] Understandably, the client refers to the browser installed on the terminal device. The core component of the browser is the browser kernel, which is the rendering engine used by the browser, which determines how the browser displays the content of the web page and the format information of the page. The current mainstream browser kernels include the Trident kernel of Microsoft IE browser, the Gecko kernel used by Firefox browser, the Presto kernel used by Opera browser, and the Webkit kernel used by Chrome browser and Safari browser. The login request refers to the web page address of the page jump from the current page of the browser to the authorized login page during the open authorization login process, that is, the Uniform / Universal Resource Locator (URL). In this embodiment, the first client is the current browser, the first login request is the web page address of the login page jump of the third-party platform triggered by the user through the current browser, and the first login request contains the unique identification parameter of the current browser, and the third-party platform is used to provide open authorization services for different clients.
[0029] S20. Perform a page jump according to the first login request and obtain a page jump result.
[0030] Understandably, when the browser triggers the login page jump event, the browser kernel sends a HyperText Transfer Protocol (HTTP) request to the web server of the third-party platform. After receiving the HTTP request, the web server generates an HTTP response based on the information carried in the corresponding HTTP request and returns it to the browser kernel. The browser kernel renders the web page corresponding to the first login request based on the HTTP response. The page jump result refers to whether the web page corresponding to the first login request can be successfully rendered on the first client. If the rendering is successful, the page jump is successful. If the rendering fails, the page jump fails. For example, online banking and payment systems only support IE browsers with Trident kernels. Other browsers that are not Trident kernels cannot perform normal payment and transfer services at all, which will cause page jump failure.
[0031] S30: If the page jump result is a page jump failure, obtain page jump configuration information, and generate a client switching instruction according to the page jump configuration information.
[0032] Understandably, after sending an HTTP request to a web server through the browser kernel of the current browser, the web server may not be able to receive the HTTP request because the current browser does not meet the requirements of the third-party platform, resulting in a page jump failure. After the web server receives the HTTP request, it generates an HTTP response based on the information carried in the corresponding HTTP request and returns it to the browser kernel. However, the browser may not be able to render the web page corresponding to the first login request because it does not support third-party jump login, resulting in a page jump failure. Page jump configuration information refers to information about the configuration requirements of the third-party platform for the browser, such as browser kernel type information, browser version information, and browser protocol information. When the page jump result is a page jump failure, a client switching instruction is generated according to the page jump configuration information, and the client switching instruction is used to switch from the current browser to the browser corresponding to the page jump configuration information.
[0033] S40: acquiring candidate client configuration information of a plurality of candidate clients according to the client switching instruction, traversing the candidate client configuration information according to the page jump configuration information, and determining a second client among the plurality of candidate clients.
[0034] Understandably, the client to be selected refers to multiple browser clients installed on the terminal device of the current user, and the client to be selected configuration information refers to the browser configuration information corresponding to each client to be selected. The second client refers to the browser client corresponding to the page jump configuration information in the client to be selected, that is, the browser after switching, and the second client can meet the configuration requirements of the third-party platform for the browser. The second client and the first client can be the same or different. In one embodiment, the client to be selected configuration information of multiple clients to be selected is traversed according to the page jump configuration information for one-to-one comparison, and the browser with consistent comparison is determined as the second client. In another embodiment, in order to be able to display various web pages more completely and more outstandingly, some multi-core browsers with at least two browser kernels have appeared. According to the client switching instruction, the browser kernel configuration information of multiple browser kernels to be selected in the multi-core browser is obtained, and according to the page jump configuration information, the multiple browser kernel configuration information to be selected is traversed, and the browser kernel corresponding to the page jump configuration information is determined as the second client, that is, the browser kernel after switching.
[0035] S50: Receive a second login request sent by the second client, redirect the page according to the second login request, generate an authorized login page for the second client, and complete the login through the authorized login page for the second client.
[0036] Understandably, the second login request is the webpage address of the user triggering the jump of the login page of the third-party platform through the browser after switching, and the second login request contains the unique identification parameter of the browser after switching. In one embodiment, after determining the browser after switching, the startup parameters of the second client are obtained to open the browser after switching, and the second login request is sent to the webpage server of the third-party platform through the browser after switching. The webpage server responds to the second login request to jump the page, and the browser after switching generates an authorized login page. In another embodiment, after determining the browser kernel after switching, the second login request is sent to the webpage server of the third-party platform through the browser kernel after switching, and the webpage server responds to the second login request to jump the page, and the browser after switching generates an authorized login page in the browser.
[0037] This embodiment receives a first login request sent by a first client; performs a page jump according to the first login request and obtains a page jump result; if the page jump result is a page jump failure, obtains page jump configuration information, and generates a client switching instruction according to the page jump configuration information; obtains the candidate client configuration information of multiple candidate clients according to the client switching instruction, traverses the candidate client configuration information according to the page jump configuration information, and determines a second client among the multiple candidate clients; receives a second login request sent by a second client, performs a page jump according to the second login request, and generates an authorized login page for the second client, so as to complete the login through the authorized login page of the second client. After the login page jump of the first client fails, this embodiment determines the second client according to the page jump configuration information, ensures the success rate of the login page jump, simplifies the client switching process, and improves the convenience of login and the user experience.
[0038] Optionally, in step S20, that is, after performing page redirection according to the first login request and obtaining the page redirection result, the method further includes:
[0039] S201. If the page jump result is that the page jump is successful, generating an authorization login page for the first client;
[0040] S202: Parse the first login request to obtain first client account information and first client key information;
[0041] S203: Verify the first client account information and the first client key information through the authorization login page of the first client, and generate a login authorization code for the first client after the verification is successful.
[0042] Understandably, the authorization login page of the first client refers to the authorization login page rendered by the first client. After the browser kernel of the current browser sends an HTTP request to the web server, there is neither the inability of the web server to receive the HTTP request due to the current browser not meeting the requirements of the third-party platform, nor the inability to render the web page corresponding to the first login request due to the browser not supporting the third-party jump login, so that the page jump is successful, and the authorization login page is generated in the current browser. The first client account information and the first client key information are the browser account information and browser key information registered by the current browser on the third-party platform. In order to realize the authorized login of the browser and the third-party platform, the browser needs to submit the browser registration information to the third-party platform in advance, and the third-party platform generates the browser account information and browser key information corresponding to the browser according to the browser registration information, which is used for the third-party platform to verify the browser. The first login request includes not only the unique identification parameter of the current browser, but also the browser account information and browser key information corresponding to the browser. After the third-party platform verifies the browser account information and browser key information, it generates the login authorization code of the current browser. The login authorization code is the authorization identification assigned by the third-party platform to the current browser, and the current browser can obtain the access token and user identity information through the login authorization code. In order to prevent abuse of login authorization, the login authorization code has a certain time limit. For example, a 30-minute validity period is set for the login authorization code, and it needs to be obtained again after the validity period expires.
[0043] In this embodiment, when the page jump result of the first client is a successful page jump, the first client account information and the first client key information are directly verified to obtain the login authorization code of the third-party platform, without the need to compare the client configuration information for each login jump, thereby further optimizing the page jump process and improving the convenience of login.
[0044] Optionally, in step S30, that is, after generating the client switching instruction according to the page jump configuration information, the step further includes:
[0045] S301, acquiring historical client configuration information according to the client switching instruction;
[0046] S302: Determine a third client according to the page jump configuration information and the historical client configuration information to receive a third login request sent by the third client.
[0047] Understandably, the third client refers to a browser client that corresponds to the page jump configuration information in the browser corresponding to the historical client configuration information. The historical client configuration information refers to the browser configuration information stored by the web server of the third-party platform that enables the page jump to succeed. The page jump configuration information and the historical client configuration information are compared. If the comparison is consistent, the browser corresponding to the page jump configuration information is obtained as the third client. At this time, the third client meets the current third-party platform's configuration requirements for the browser. The third client and the first client can be the same or different. The third login request is the web page address that the user triggers the login page jump of the third-party platform through the third client. The third login request contains the unique identification parameter of the third client.
[0048] This embodiment determines the third client based on the page jump configuration information and the historical client configuration information, which can narrow the scope of client configuration information comparison without traversing one by one for comparison, which helps to quickly switch clients and ensure the success rate of login page jump.
[0049] Optionally, in step S40, that is, after determining the second client among the plurality of the to-be-selected clients, the step further includes:
[0050] S401, obtaining target access request information through a second client;
[0051] S402, obtaining second client account information and second client key information through the second client;
[0052] S403: The second client concatenates the target access request information, the second client account information and the second client key information to generate the second login request.
[0053] Understandably, the target access request information refers to the basic website information of the target website that the user requests to access through the browser, so that after obtaining the login authorization code of the third-party platform, the target website can be browsed through the browser. The second client is the browser after switching. With the switching of the browser, the target access information stored in the first login request has been lost, so the target access request information must be retrieved through the browser after switching. The second client account information and the second client key information are identity authentication information used by the third-party platform to verify the browser after switching. The target access request information, the second client account information, and the second client key information are spliced by the second client to generate a second login request, that is, the web page address for jumping to the login page is redirected from the browser after switching to the third-party platform.
[0054] This embodiment generates a second login request by splicing parameters through the second client to achieve redirection of the browser after switching to the third-party platform for login page jump, thereby ensuring the success rate of login page jump and improving the user experience.
[0055] Optionally, in step S50, that is, performing page jump according to the second login request to generate an authorization login page for the second client, includes:
[0056] S501, calling the server middleware according to the second login request, and obtaining the authorization login page data through the server middleware;
[0057] S502, generating an authorization login page character string according to the authorization login page data;
[0058] S503: Return the authorization login page character string to the second client, so that the second client generates an authorization login page of the second client according to the authorization login page character string.
[0059] Understandably, the authorization login page of the second client refers to the authorization login page rendered on the second client, that is, the authorization login page loaded by the browser after switching. The rendering methods of the page include server-side rendering and client-side rendering, wherein the server-side rendering is to first generate a Hypertext Markup Language (HTML) string on the server, and then send it to the browser for rendering, while the client-side rendering is to first return an empty HTML file from the server, and then load JavaScript inside the client, and the page rendering is completed entirely by JavaScript. In one embodiment, the server-side rendering method is adopted, and the server-side middleware is called according to the second login request. The server will first execute the "_app.getInitialProps" method, and then traverse all the "_page.getInitialProps" methods to obtain all the authorization login page data and assemble them to generate the authorization login page HTML string. The server returns the authorization login page HTML string to the second client, so that the second client generates the second client's authorization login page according to the authorization login page string.
[0060] This embodiment generates an authorization login page on the second client through server-side rendering, which helps to quickly load the authorization login page and improves the user experience.
[0061] Optionally, in step S50, that is, after the page jump is performed according to the second login request to generate the authorization login page of the second client, the method further includes:
[0062] S504: Parse the second login request to obtain the second client account information and the second client key information;
[0063] S505: Verify the second client account information and the second client key information through the second client authorization login page, and generate a login authorization code for the second client after the verification is successful.
[0064] Understandably, the web server of the third-party platform parses the second login request, obtains the second client account information and the second client key information and verifies them. After the verification is passed, the login authorization code of the second client is generated, that is, the authorized login of the browser after the switch is completed. In one embodiment, authorized login is implemented through GitHub as a third-party platform, wherein the user enters the target website through the second client, and the web server of the third-party platform GitHub redirects the page of the second client through the second login request, so that the page jumps to the GitHub authorized login page. The second client account information and the second client key information are verified through the GitHub authorized login page, and the login authorization code is returned to the second client after the verification is passed.
[0065] This embodiment realizes the redirection of the browser after switching to the third-party platform for login page by verifying the second client account information and the second client key information, thereby ensuring the success rate of login page jump and improving the user experience.
[0066] Optionally, in step S50, that is, before receiving the second login request sent by the second client, the following steps are included:
[0067] S506, comparing the first client and the second client to determine whether they are the same;
[0068] S507: If they are the same, generate fault notification information, which is used to enable the user to eliminate network fault problems and client limitation problems caused by page jumps.
[0069] Understandably, the browser after switching may be the same as the browser before switching, that is, the current browser is already the browser corresponding to the page jump configuration information. Even if the browser after switching is used, the page jump will still fail. At this time, simply switching the browser cannot solve the problem, and it needs to be solved from the aspects of network and client restrictions. In addition to the configuration problem of the browser, the failure of the third-party login page jump is also related to network problems and client restrictions. For example, the client needs to use a specific domain name, a specific callback address, and a specific login page. In one embodiment, when the browser after switching is the same as the current browser, a fault notification message is generated, so that the user can eliminate the network fault problem and client restriction problem of the page jump according to the fault notification message.
[0070] This embodiment directly generates fault notification information when the first client and the second client are the same, so that the user can check the problem in a targeted manner, solve the page jump failure problem in time, and improve the efficiency of login page jump.
[0071] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0072] In one embodiment, a login device based on an open authorization protocol is provided, and the login device based on the open authorization protocol corresponds one-to-one to the login method based on the open authorization protocol in the above embodiment. Figure 2 As shown, the login device based on the open authorization protocol includes a first login request receiving module 10, a page jump result obtaining module 20, a client switching instruction generating module 30, a second client determining module 40 and a second client login module 50. The functional modules are described in detail as follows:
[0073] A first login request receiving module 10, configured to receive a first login request sent by a first client;
[0074] A page jump result acquisition module 20, configured to perform a page jump according to the first login request and acquire a page jump result;
[0075] The client switching instruction generating module 30 is used to obtain page jump configuration information if the page jump result is a page jump failure, and generate a client switching instruction according to the page jump configuration information;
[0076] A second client determination module 40 is configured to obtain the candidate client configuration information of multiple candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the multiple candidate clients;
[0077] The second client login module 50 is used to receive the second login request sent by the second client, perform page jump according to the second login request, and generate an authorized login page for the second client to complete the login through the authorized login page of the second client.
[0078] Optionally, the page jump result acquisition module 20 includes:
[0079] A first client page generating unit, configured to generate an authorization login page for the first client if the page jump result is that the page jump is successful;
[0080] A first login request parsing unit, configured to parse the first login request to obtain first client account information and first client key information;
[0081] The first login authorization code generating unit is used to verify the first client account information and the first client key information through the authorization login page of the first client, and generate a login authorization code for the first client after the verification is passed.
[0082] Optionally, the client switching instruction generating module 30 includes:
[0083] A historical client configuration information acquisition unit, configured to acquire historical client configuration information according to the client switching instruction;
[0084] The third client determining unit is used to determine the third client according to the page jump configuration information and the historical client configuration information, so as to receive a third login request sent by the third client.
[0085] Optionally, the second client determination module 40 includes:
[0086] A target access request information acquisition unit, configured to acquire the target access request information through the second client;
[0087] A second client information acquisition unit, used to acquire second client account information and second client key information through the second client;
[0088] The second login request generating unit is used to generate the second login request by splicing the target access request information, the second client account information and the second client key information through the second client.
[0089] Optionally, the second client login module 50 includes:
[0090] An authorization login page data acquisition unit, configured to call the server-side middleware according to the second login request, and acquire the authorization login page data through the server-side middleware;
[0091] An authorization login page character string generating unit, used to generate an authorization login page character string according to the authorization login page data;
[0092] The second authorization login page generating unit is used to return the authorization login page character string to the second client, so that the second client generates the authorization login page of the second client according to the authorization login page character string.
[0093] Optionally, the second client login module 50 further includes:
[0094] A second login request parsing unit, configured to parse the second login request to obtain second client account information and second client key information;
[0095] The second login authorization code generating unit is used to verify the second client account information and the second client key information through the authorization login page of the second client, and generate a login authorization code for the second client after the verification is passed.
[0096] Optionally, the second client login module 50 further includes:
[0097] A client comparison unit, used to compare the first client with the second client to determine whether they are the same;
[0098] The fault notification information generating unit is used to generate fault notification information if they are the same, wherein the fault notification information is used to enable the user to eliminate network fault problems and client limitation problems caused by page jumps.
[0099] For the specific limitations of the login device based on the open authorization protocol, please refer to the limitations of the login method based on the open authorization protocol above, which will not be repeated here. Each module in the above-mentioned login device based on the open authorization protocol can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0100] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer-readable instructions are executed by the processor, a login method based on an open authorization protocol is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0101] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-readable instructions to implement the following steps:
[0102] Receiving a first login request sent by a first client;
[0103] Performing a page jump according to the first login request, and obtaining a page jump result;
[0104] If the page jump result is a page jump failure, obtaining page jump configuration information, and generating a client switching instruction according to the page jump configuration information;
[0105] Acquire the candidate client configuration information of the plurality of candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the plurality of candidate clients;
[0106] A second login request sent by the second client is received, a page jump is performed according to the second login request, and an authorized login page of the second client is generated to complete the login through the authorized login page of the second client.
[0107] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media store computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the following steps are implemented:
[0108] Receiving a first login request sent by a first client;
[0109] Performing a page jump according to the first login request, and obtaining a page jump result;
[0110] If the page jump result is a page jump failure, obtaining page jump configuration information, and generating a client switching instruction according to the page jump configuration information;
[0111] Acquire the candidate client configuration information of the plurality of candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the plurality of candidate clients;
[0112] A second login request sent by the second client is received, a page jump is performed according to the second login request, and an authorized login page of the second client is generated to complete the login through the authorized login page of the second client.
[0113] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0114] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0115] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A login method based on an open authorization protocol, characterized in that: include: Receiving a first login request sent by a first client; Performing a page jump according to the first login request, and obtaining a page jump result; If the page jump result is a page jump failure, obtaining page jump configuration information, and generating a client switching instruction according to the page jump configuration information; Acquire the candidate client configuration information of the plurality of candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the plurality of candidate clients; A second login request sent by the second client is received, a page jump is performed according to the second login request, and an authorized login page of the second client is generated to complete the login through the authorized login page of the second client.
2. The login method based on the open authorization protocol as claimed in claim 1, characterized in that: After performing page jump according to the first login request and obtaining the page jump result, the method further includes: If the page jump result is that the page jump is successful, generating an authorization login page for the first client; Parsing the first login request to obtain first client account information and first client key information; The first client account information and the first client key information are verified through the authorization login page of the first client, and a login authorization code of the first client is generated after the verification is passed.
3. The login method based on the open authorization protocol as claimed in claim 1, characterized in that: After the client switching instruction is generated according to the page jump configuration information, the method further includes: Acquire historical client configuration information according to the client switching instruction; A third client is determined according to the page jump configuration information and the historical client configuration information to receive a third login request sent by the third client.
4. The login method based on the open authorization protocol as claimed in claim 1, characterized in that: After determining the second client among the plurality of the to-be-selected clients, the method further includes: Obtaining target access request information through a second client; Acquire the second client account information and the second client key information through the second client; The second client concatenates the target access request information, the second client account information and the second client key information to generate the second login request.
5. The login method based on the open authorization protocol as claimed in claim 1, characterized in that: The step of redirecting a page according to the second login request to generate an authorization login page for the second client includes: Calling the server-side middleware according to the second login request, and obtaining the authorization login page data through the server-side middleware; Generate an authorization login page string according to the authorization login page data; The authorization login page character string is returned to the second client, so that the second client generates an authorization login page of the second client according to the authorization login page character string.
6. The login method based on the open authorization protocol as claimed in claim 1, characterized in that: After redirecting the page according to the second login request and generating the authorization login page of the second client, the method further includes: Parse the second login request to obtain the second client account information and the second client key information; The second client account information and the second client key information are verified through the second client's authorization login page, and a login authorization code for the second client is generated after the verification is passed.
7. The login method based on the open authorization protocol as claimed in claim 1, characterized in that: Before receiving the second login request sent by the second client, the method includes: Comparing the first client with the second client to determine whether they are the same; If they are the same, a fault notification message is generated, and the fault notification message is used to enable the user to eliminate network failure problems and client limitation problems caused by page jumps.
8. A login device based on an open authorization protocol, characterized in that: include: A first login request receiving module, used to receive a first login request sent by a first client; A page jump result acquisition module, used to perform a page jump according to the first login request and obtain a page jump result; A client switching instruction generating module, used for obtaining page jump configuration information if the page jump result is a page jump failure, and generating a client switching instruction according to the page jump configuration information; A second client determination module is used to obtain the candidate client configuration information of multiple candidate clients according to the client switching instruction, traverse the candidate client configuration information according to the page jump configuration information, and determine the second client among the multiple candidate clients; The second client login module is used to receive the second login request sent by the second client, perform page jump according to the second login request, and generate an authorized login page for the second client to complete the login through the authorized login page of the second client.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the login method based on the open authorization protocol as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors execute the login method based on the open authorization protocol as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for controlling login state based on mini-program architecture
CN109995755A
Website login method and device, readable medium and electronic equipment
CN112448917A