Webpage nesting configuration method and device
By aligning the domain name and port of embedded web pages with the embedded page, the method and device facilitate single sign-on across nested web pages, addressing the issue of multiple logins and improving user experience.
Patent Information
- Application Number
- CN202310744659.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2024-12-24
AI Technical Summary
Web page nesting in existing technologies often violates the same-origin policy, leading to multiple logins and preventing single sign-on across different service pages, which negatively impacts user experience.
A method and device that determine if the login systems of the web pages to be embedded and embedded are the same, and if not, replace the domain name and port of the embedded page to align them with the embedded page, allowing for cross-domain single sign-on.
Enables single sign-on across nested web pages by ensuring they comply with the same-origin policy, requiring only one login for all business services, thereby enhancing user experience.
Smart Images

Figure CN119182542A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a web page nesting configuration method and device. Background Art
[0002] With the development of Internet technology and the continuous accumulation of user needs, users will use a variety of business services through terminals. In other words, users need to deploy multiple service web pages in the terminal. Accordingly, in the process of web page development, it is necessary to nest the service web pages, that is, integrate multiple service web pages into one head-end page to meet the needs of users to use a variety of business services through terminals.
[0003] At present, in the prior art, web page nesting is usually performed directly through the IFRAME inline frame. However, since web page nesting may violate the same-origin policy, that is, cross-domain situation, it will cause users to log in multiple times when using different service pages on the terminal, and single sign-on to the nested web pages cannot be achieved, which in turn affects the user experience. Summary of the invention
[0004] In view of the above problems, the present invention provides a webpage nesting configuration method and device, the main purpose of which is to achieve single sign-on for nested webpages and improve the user experience.
[0005] In order to solve the above technical problems, the present invention proposes the following solutions:
[0006] In a first aspect, the present invention provides a web page nesting configuration method, the method comprising:
[0007] When performing a web page nesting operation, determining whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same;
[0008] If so, when the web page to be embedded and the embedded web page do not comply with the same-origin policy, the domain name and port corresponding to the web page to be embedded are replaced based on the domain name and port corresponding to the embedded web page, so that the client can automatically perform a cross-domain login operation on the web pages contained in the embedded web page based on the single sign-on operation on the embedded web page.
[0009] In a second aspect, the present invention provides a webpage nesting configuration device, the device comprising:
[0010] A judgment unit, used to judge whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same when performing the web page nesting operation;
[0011] A processing unit is used to replace the domain name and port corresponding to the web page to be embedded based on the domain name and port corresponding to the embedded web page if the judgment unit determines that the login system corresponding to the web page to be embedded is the same as that corresponding to the embedded web page. If the web page to be embedded and the embedded web page do not comply with the same-origin policy, so that the client can automatically perform a cross-domain login operation on the web page contained in the embedded web page based on the single sign-on operation on the embedded web page.
[0012] In order to achieve the above object, according to a third aspect of the present invention, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the web page nesting configuration method of the first aspect.
[0013] In order to achieve the above-mentioned purpose, according to the fourth aspect of the present invention, an electronic device is provided, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the web page nesting configuration method of the first aspect above.
[0014] By means of the above technical scheme, a webpage nesting configuration method and device provided by the present invention is that when a webpage needs to be nested, when a webpage nesting operation is performed, it is determined whether the login systems corresponding to the webpage to be embedded and the embedded webpage are the same. If so, when the webpage to be embedded and the embedded webpage do not comply with the same-origin policy, the domain name and port corresponding to the webpage to be embedded are replaced based on the domain name and port corresponding to the embedded webpage, so that the client automatically performs a cross-domain login operation on the webpage contained in the embedded webpage based on the single-point sign-on operation on the embedded webpage. Through the technical scheme provided by the present invention, after the webpage to be embedded is nested to the embedded webpage to become an included webpage of the embedded webpage, the domain name and port of the included webpage of the embedded webpage are consistent with the embedded webpage, so that the included webpage of the embedded webpage and the embedded webpage comply with the same-origin policy and correspond to the same login system, so that the user can automatically perform a cross-domain login operation on the webpage contained in the embedded webpage based on the single-point sign-on operation on the embedded webpage, and the single-point sign-on of the nested webpage is realized, that is, only one login is required to use all business services in the nested webpage, thereby improving the user's experience.
[0015] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0017] Figure 1 A flow chart of a web page nesting configuration method provided by an embodiment of the present invention is shown;
[0018] Figure 2 A flow chart of another web page nesting configuration method provided by an embodiment of the present invention is shown;
[0019] Figure 3 A block diagram showing a composition of a webpage nesting configuration device provided by an embodiment of the present invention;
[0020] Figure 4 A block diagram showing another webpage nesting configuration device provided by an embodiment of the present invention is shown;
[0021] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0022] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0023] At present, in the prior art, web page nesting is usually performed directly through the IFRAME inline frame. However, since web page nesting may violate the same-origin policy, i.e., cross-domain, it will cause the user to log in multiple times when using different service pages on the terminal, and it is impossible to achieve single-point sign-on for the nested web page, thereby affecting the user's experience. The present invention makes the domain name and port of the embedded web page of the embedded web page consistent with the embedded web page after the web page to be embedded is nested into the embedded web page to become the embedded web page of the embedded web page, so as to achieve the same-origin policy between the embedded web page and the embedded web page, and correspond to the same login system, so that the user can automatically perform the cross-domain login operation on the embedded web page based on the single-point sign-on operation on the embedded web page on the client, and achieve single-point sign-on for the nested web page, that is, only need to log in once to use all business services in the nested web page, thereby improving the user's experience.
[0024] To this end, an embodiment of the present invention provides a webpage nesting configuration method, through which single sign-on for nested webpages can be achieved, improving the user experience. The specific execution steps are as follows: Figure 1 As shown, including:
[0025] 101. When performing a webpage nesting operation, determine whether the login systems corresponding to the webpage to be embedded and the webpage to be embedded are the same.
[0026] It should be noted that, in the present embodiment, the web page to be embedded is the web page that needs to be embedded in other web pages, and the embedded web page is the web page embedded by other web pages, and the login system refers to a single sign-on system, that is, only one login is required to access other mutually trusted application systems. Since different web pages may correspond to different login systems, and different login systems cannot implement single sign-on, therefore, when executing the web page nesting operation, it can be determined whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same, that is, it is determined whether the login systems corresponding to the web page to be embedded and the web page to be embedded correspond to the same single sign-on system. Specifically, the web page to be embedded and the web page to be embedded can be loaded separately in the test browser to jump to their respective corresponding login pages. Since the page features and unique resource locators of the same login system are similar, it can be determined based on the page features and / or unique resource locators whether the two login pages are similar pages. If so, the subsequent step 102 is executed. If not, a prompt message can be generated to remind the operator to re-execute the web page nesting operation, that is, replace other web pages to be embedded or embedded web pages.
[0027] 102. When the web page to be embedded and the embedded web page do not comply with the same-origin policy, the domain name and port corresponding to the web page to be embedded are replaced based on the domain name and port corresponding to the embedded web page, so that the client can automatically perform a cross-domain login operation on the web pages contained in the embedded web page based on the single sign-on operation on the embedded web page.
[0028] It should be noted that, in this embodiment, the same-origin policy refers to a security policy that ensures that the normal functions of the browser are not affected by the same protocol, domain name, and port of the web page. When the domain name and port are different among the above three, the cookies, localStorage, and indexDB of the corresponding web page cannot be read, the DOM cannot be obtained, and the ajax request cannot be sent. However, since it can be seen from the aforementioned step 101 that the web page to be embedded and the embedded web page correspond to the same login system, therefore, when the web page to be embedded and the embedded web page do not comply with the same-origin policy, the domain name corresponding to the web page to be embedded can be replaced based on the domain name and port corresponding to the embedded web page. and port, for example, assuming that the URL of the embedded webpage is http: / / www.a.com:8080 / xxxxa, and the URL of the webpage to be embedded is http: / / www.b.com:9090 / xxxxb, the URL of the webpage to be embedded can be replaced with http: / / www.a.com:8080 / b / xxxxb, so that the webpage to be embedded after the webpage nesting operation is consistent with the domain name and port of the embedded webpage, that is, it complies with the homology policy after becoming the webpage included in the embedded webpage, so that the client can automatically perform the cross-domain login operation on the webpage included in the embedded webpage based on the single sign-on operation on the embedded webpage. It should be emphasized that based on the nesting mechanism of the IFRAME inline frame, the protocol of the webpage to be embedded will automatically follow the protocol of the embedded webpage after nesting, so whether the protocol of the webpage is replaced is not considered in this embodiment.
[0029] Based on the above Figure 1 It can be seen from the implementation method of the above technical scheme that the webpage nesting configuration method provided by the present invention is that when it is necessary to perform webpage nesting configuration on a webpage, when performing a webpage nesting operation, it is determined whether the login systems corresponding to the webpage to be embedded and the embedded webpage are the same. If so, when the webpage to be embedded and the embedded webpage do not comply with the same-origin policy, the domain name and port corresponding to the webpage to be embedded are replaced based on the domain name and port corresponding to the embedded webpage, so that the client automatically performs a cross-domain login operation on the webpage contained in the embedded webpage based on the single-point sign-on operation on the embedded webpage. Through the technical scheme provided by the present invention, after the webpage to be embedded is nested to the embedded webpage to become an included webpage of the embedded webpage, the domain name and port of the included webpage of the embedded webpage are consistent with the embedded webpage, so that the included webpage of the embedded webpage and the embedded webpage comply with the same-origin policy and correspond to the same login system, so that the user can automatically perform a cross-domain login operation on the webpage contained in the embedded webpage based on the single-point sign-on operation on the embedded webpage on the client, and implement a single-point sign-on to the nested webpage, that is, only one login is required to use all business services in the nested webpage, thereby improving the user experience.
[0030] Further, the preferred embodiment of the present invention is in the above Figure 1 Based on this, a detailed description of the process of web page nesting configuration is given. The specific steps are as follows Figure 2 As shown, including:
[0031] 201. When performing a webpage nesting operation, determine whether the login systems corresponding to the webpage to be embedded and the webpage to be embedded are the same.
[0032] This step is combined with the description of step 101 in the above method, and the same contents are not repeated here. It should be noted that in this step, the specific execution process for determining whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same is: respectively load the login page of the web page to be embedded and the login page of the web page to be embedded; determine whether the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages; if so, determine that the login systems corresponding to the web page to be embedded and the web page to be embedded are the same; if not, determine that the login systems corresponding to the web page to be embedded and the web page to be embedded are not the same. Among them, a test browser can be selected to load the login page of the web page to be embedded and the login page of the web page to be embedded, and the similar page is used to characterize the page whose similarity of page features or unique resource locators reaches a certain threshold. Therefore, by determining whether the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages, it can be determined whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same.
[0033] Furthermore, the specific execution process corresponding to the above-mentioned determination of whether the login page of the web page to be embedded and the login page of the embedded web page are similar pages is: respectively extracting the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the embedded web page; determining whether the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the embedded web page meet the similarity rule, wherein the similarity rule is used to characterize the determination rule that only the parameter part of the unique resource locator is different; if so, determining that the login page of the web page to be embedded and the login page of the embedded web page are similar pages; if not, determining that the login page of the web page to be embedded and the login page of the embedded web page are not similar pages.
[0034] It should be noted that in this step, since the unique resource locators corresponding to different web pages of the same login system generally have only differences in the parameter part, the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the web page to be embedded can be compared and judged. If only the parameter part is different, it means that the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages, otherwise it means that the login page of the web page to be embedded and the login page of the web page to be embedded are not similar pages. Since the page features may have many differences based on the UI of the page, the unique resource locator is used to judge the similar pages, so as to ensure the accuracy of the judgment of the similar pages, and then improve the accuracy of judging whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same.
[0035] 202. Detect whether the web page to be embedded is a nested web page.
[0036] It should be noted that in this step, the web page to be embedded can be a single web page or a nested web page embedded in other web pages. Therefore, it is possible to first detect whether the web page to be embedded is a nested web page. Specifically, the attribute configuration information of the web page to be embedded can be traversed to determine whether there is an IFRAME inline frame therein. If so, it means that the web page to be embedded is a nested web page, and the subsequent step 203 is executed. Otherwise, it means that the web page to be embedded is not a nested web page, that is, it is a single web page, and the subsequent step 204 is executed.
[0037] 203 . According to the nesting relationship corresponding to the web page to be embedded, the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded are replaced with the domain name and port of the web page to be embedded.
[0038] It should be noted that in this step, since it has been determined in the aforementioned step 203 that the web page to be embedded is a nested web page, but since the nested web page can be nested in one layer or multiple layers, and the domain name and port change operation is generally only performed by the outer web page to change the inner web page, therefore, in order to ensure the replacement integrity of the domain name and port of the web page contained in the web page to be embedded, specifically, the nesting relationship corresponding to the web page to be embedded is determined according to the inline frame of the web page to be embedded; the hierarchical structure of the web page to be embedded is determined using the nesting relationship corresponding to the web page to be embedded; according to the hierarchical structure corresponding to the web page to be embedded, the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded are replaced with the domain name and port of the embedded web page step by step from inside to outside. Among them, the nesting relationship can be determined based on the inline frame in the attribute configuration information of the web page to be embedded, and the hierarchical structure of the web page to be embedded can be determined based on the nesting relationship, that is, the nested inner and outer structure, therefore, according to the hierarchical structure corresponding to the web page to be embedded, the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded are replaced with the domain name and port of the embedded web page step by step from inside to outside. That is, the outermost layer changes the second-outer layer, the second-outer layer changes the second-inner layer, the second-inner layer changes the inner layer, and so on, thereby ensuring the integrity of the embedded web page and the web pages contained in the embedded web page are replaced with the domain name and port of the embedded web page.
[0039] For example, assuming that the URL of the web page c to be embedded is http: / / www.c.com / , and the URL of the web page a to be embedded is http: / / www.a.com / , based on the above logic, the URL of the web page a to be embedded has been replaced with http: / / www.c.com / a-path / xxxx, and the web page to be embedded contains a web page b whose URL is http: / / www.b.com / . Since the web page to be embedded contains web page b, when the web page a to be embedded is nested, based on the above logic, by default, the URL of the web page b contained in the web page to be embedded has been replaced with http: / / www.a.c.com / . om / b-path / xxxx, therefore, website A is required to obtain the domain name part and port part of web page c (that is, www.c.com, 80, where the ports of web page b to be embedded, web page a to be embedded and web page c are all 80 by default, so they are not explained in this example), and replace the domain name part and port part of web page b to be embedded in the web page based on the domain name part and port part of web page c, that is, replace http: / / www.a.com / b-path / xxxx with http: / / www.c.com / b-path / xxxx, and this URL can also access web page b contained in the web page to be embedded.
[0040] Furthermore, since the web page to be embedded is a nested web page, the domain name and port replacement operation may not be performed between the web page to be embedded and the web page contained in the web page to be embedded. At this time, in order to improve the replacement efficiency of the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded, specifically, before replacing the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the embedded web page step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded, the method also includes: detecting whether the domain name and interface of the web page to be embedded and the web page contained in the web page to be embedded are consistent; if so, replacing the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the embedded web page step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded; if not, directly replacing the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the embedded web page. That is, if they are consistent, they are replaced step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded, and if they are inconsistent, they are directly replaced, thereby improving the replacement efficiency of the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded.
[0041] 204. Directly replace the domain name and port of the web page to be embedded with the domain name and port of the web page to be embedded.
[0042] It should be noted that in this step, since it has been determined in the aforementioned step 203 that the web page to be embedded is not a nested web page, that is, a single web page, the domain name and port of the web page to be embedded can be directly replaced with the domain name and port of the embedded web page.
[0043] 205. Generate prompt information to prompt the operator to re-execute the webpage nesting operation.
[0044] It should be noted that in this step, since the aforementioned step 201 has determined that the login systems of the web page to be embedded and the web page to be embedded are different, that is, there may be a situation where the operator incorrectly selects the web page to be embedded or the web page to be embedded. Therefore, in order to ensure the efficiency and correctness of the web page nesting operation, a prompt information can be generated to prompt the operator to re-execute the web page nesting operation, wherein the prompt information includes but is not limited to the unique resource locators of the login systems corresponding to the web page to be embedded and the web page to be embedded, as well as different parts of the unique resource locators, so that the operator can quickly locate the wrongly selected web page, and this embodiment does not limit this.
[0045] Furthermore, as a response to the above Figure 1-2The implementation of the method embodiment shown in the figure, the embodiment of the present invention provides a webpage nesting configuration device, which is used to implement single sign-on for nested webpages and improve the user experience. The embodiment of the device corresponds to the aforementioned method embodiment. For ease of reading, this embodiment will no longer repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Specifically, Figure 3 As shown, the device comprises:
[0046] A determination unit 31, used to determine whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same when performing a web page nesting operation;
[0047] The processing unit 32 is used to replace the domain name and port corresponding to the web page to be embedded based on the domain name and port corresponding to the embedded web page if the judgment unit 31 judges that the login system corresponding to the web page to be embedded is the same as that corresponding to the embedded web page. When the web page to be embedded and the embedded web page do not comply with the same-origin policy, so as to automatically perform a cross-domain login operation on the web page contained in the embedded web page on the client side based on the single sign-on operation on the embedded web page.
[0048] Further, such as Figure 4 As shown, the processing unit 32 includes:
[0049] A detection module 321 is used to detect whether the web page to be embedded is a nested web page;
[0050] The first processing module 322 is used to replace the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the embedded web page according to the nesting relationship corresponding to the web page to be embedded if the detection module 321 detects that the web page to be embedded is a nested web page;
[0051] The second processing module 323 is used to directly replace the domain name and port of the web page to be embedded with the domain name and port of the embedded web page if the detection module 321 detects that the web page to be embedded is not a nested web page.
[0052] Further, such as Figure 4 As shown, the first processing module 322 includes:
[0053] A first determining submodule 3221 is used to determine the nesting relationship corresponding to the web page to be embedded according to the inline frame of the web page to be embedded;
[0054] A second determining submodule 3222 is used to determine the hierarchical structure of the web page to be embedded using the nesting relationship corresponding to the web page to be embedded obtained by the first determining submodule 3221;
[0055] The processing submodule 3223 is used to replace the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the embedded web page from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded obtained by the second determining submodule 3222.
[0056] Further, such as Figure 4 As shown, before processing submodule 3223, the device further includes:
[0057] A detection submodule 3224 is used to detect whether the domain name and interface of the web page to be embedded are consistent with the web page included in the web page to be embedded;
[0058] The processing submodule 3223 is configured to replace the domain names and ports of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the web page to be embedded step by step from inside to outside according to the hierarchical structure corresponding to the web page to be embedded, if the detection submodule 3224 detects that the domain name and interface of the web page to be embedded are consistent with those of the web page contained in the web page to be embedded;
[0059] The processing submodule 3223 is also used to directly replace the domain name and port of the web page to be embedded and the web page included in the web page to be embedded with the domain name and port of the embedded web page if the detection submodule 3224 detects that the domain name and interface of the web page to be embedded are inconsistent.
[0060] Further, such as Figure 4 As shown, the device also includes:
[0061] The generating unit 33 is configured to generate a prompt message to prompt the operator to re-execute the webpage nesting operation if the judging unit 31 judges that the login system corresponding to the webpage to be embedded is different from that corresponding to the webpage to be embedded.
[0062] Further, such as Figure 4 As shown, the judging unit 31 includes:
[0063] A loading module 311, used to load the login page of the web page to be embedded and the login page of the embedded web page respectively;
[0064] A judging module 312 is used to judge whether the login page of the web page to be embedded obtained by the loading module 311 and the login page of the web page to be embedded are similar pages;
[0065] The determination module 313 is used to determine that the login system corresponding to the web page to be embedded is the same as that of the web page to be embedded if the determination module 312 determines that the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages;
[0066] The determination module 313 is further configured to determine that the login systems corresponding to the web page to be embedded and the embedded web page are different if the determination module 312 determines that the login page of the web page to be embedded and the login page of the embedded web page are not similar pages.
[0067] Further, such as Figure 4 As shown, the judging module 312 includes:
[0068] An extraction submodule 3121 is used to extract the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the web page to be embedded respectively;
[0069] A judgment submodule 3122 is used to judge whether the unique resource locator corresponding to the login page of the web page to be embedded obtained by the extraction submodule 3121 and the unique resource locator corresponding to the login page of the web page to be embedded meet a similarity rule, wherein the similarity rule is used to characterize the judgment rule that only the parameter part of the unique resource locator is different;
[0070] A third determining submodule 3123 is configured to determine that the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages if the determining submodule 3122 determines that the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the web page to be embedded meet the similarity rule;
[0071] The third determination submodule 3123 is also used to determine that the login page of the web page to be embedded and the login page of the embedded web page are not similar pages if the judgment submodule 3122 determines that the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the embedded web page do not meet the similarity rule.
[0072] Furthermore, an embodiment of the present invention also provides an electronic device, the electronic device includes a processor and a memory, the above-mentioned judgment unit 31 and processing unit 32 are stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions. The processor includes a kernel, and the kernel calls the corresponding program unit from the memory.
[0073] The kernel can be set to one or more, and single sign-on to nested web pages can be achieved by adjusting kernel parameters to improve user experience.
[0074] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the web page nesting configuration method is implemented.
[0075] An embodiment of the present invention provides a processor, which is used to run a program, wherein the web page nesting configuration method is executed when the program is running.
[0076] The embodiment of the present invention provides a device 40, such as Figure 5 As shown, the device 40 includes at least one processor 401, at least one memory 402 connected to the processor 401, and a bus 403; wherein the processor 401 and the memory 402 communicate with each other through the bus 403; the processor 401 is used to call the program instructions in the memory 402 to execute the above web page nesting configuration method. The device in this article can be a server, PC, PAD, mobile phone, etc.
[0077] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: when executing a web page nesting operation, determining whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same; if so, when the web page to be embedded and the web page to be embedded do not comply with the same-origin policy, replacing the domain name and port corresponding to the web page to be embedded based on the domain name and port corresponding to the web page to be embedded, so that the client automatically performs a cross-domain login operation on the web pages contained in the embedded web page based on a single sign-on operation on the embedded web page.
[0078] The method of replacing the domain name and port corresponding to the web page to be embedded based on the domain name and port corresponding to the embedded web page, so as to automatically perform a cross-domain login operation on the web page contained in the embedded web page based on the user's single sign-on operation on the embedded web page on the client, includes: detecting whether the web page to be embedded is a nested web page; if so, replacing the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the embedded web page according to the nesting relationship corresponding to the web page to be embedded; if not, directly replacing the domain name and port of the web page to be embedded with the domain name and port of the embedded web page.
[0079] The replacing the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the embedded web page according to the nesting relationship corresponding to the web page to be embedded, comprises: determining the nesting relationship corresponding to the web page to be embedded according to the inline frame of the web page to be embedded; determining the hierarchical structure of the web page to be embedded by using the nesting relationship corresponding to the web page to be embedded; replacing the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the embedded web page step by step from inside to outside according to the hierarchical structure corresponding to the web page to be embedded.
[0080] Before replacing the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the embedded web page step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded, the method also includes: detecting whether the domain name and interface of the web page to be embedded and the web pages contained in the web page to be embedded are consistent; if so, replacing the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the embedded web page step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded; if not, directly replacing the domain name and port of the web page to be embedded with the domain name and port of the embedded web page.
[0081] If it is determined that the login systems corresponding to the webpage to be embedded and the webpage to be embedded are different, the method further includes: generating prompt information to prompt the operator to re-execute the webpage nesting operation.
[0082] The detecting whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same includes: loading the login page of the web page to be embedded and the login page of the web page to be embedded respectively; judging whether the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages; if so, determining that the login systems corresponding to the web page to be embedded and the web page to be embedded are the same; if not, determining that the login systems corresponding to the web page to be embedded and the web page to be embedded are different.
[0083] The determining whether the login page of the web page to be embedded and the login page of the web page to be embedded are similar pages comprises: respectively extracting the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the web page to be embedded; determining whether the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the web page to be embedded meet the similarity rule, wherein the similarity rule is used to characterize the determination rule that only the parameter part of the unique resource locator is different; if so, determining that the login page of the web page to be embedded and the login page of the web page to be embedded are the similar pages; if not, determining that the login page of the web page to be embedded and the login page of the web page to be embedded are not the similar pages.
[0084] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0085] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.
[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0087] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0088] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0089] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0090] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A web page nesting configuration method, characterized in that: The method comprises: When performing a web page nesting operation, determining whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same; If so, when the web page to be embedded and the embedded web page do not comply with the same-origin policy, the domain name and port corresponding to the web page to be embedded are replaced based on the domain name and port corresponding to the embedded web page, so that the client can automatically perform a cross-domain login operation on the web pages contained in the embedded web page based on the single sign-on operation on the embedded web page.
2. The method according to claim 1, characterized in that The replacing the domain name and port corresponding to the web page to be embedded based on the domain name and port corresponding to the embedded web page, so as to automatically perform a cross-domain login operation on the web page included in the embedded web page based on the single sign-on operation of the user on the client side, includes: Detecting whether the web page to be embedded is a nested web page; If yes, then according to the nesting relationship corresponding to the web page to be embedded, the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded are replaced with the domain name and port of the web page to be embedded; If not, the domain name and port of the web page to be embedded are directly replaced with the domain name and port of the web page to be embedded.
3. The method according to claim 2, characterized in that The step of replacing the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the web page to be embedded according to the nesting relationship corresponding to the web page to be embedded includes: Determining the nesting relationship corresponding to the web page to be embedded according to the inline frame of the web page to be embedded; Determining the hierarchical structure of the web page to be embedded using the nesting relationship corresponding to the web page to be embedded; According to the hierarchical structure corresponding to the web page to be embedded, the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded are replaced with the domain name and port of the embedded web page step by step from the inside to the outside.
4. The method according to claim 3, characterized in that Before replacing the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the web page to be embedded step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded, the method further includes: Detecting whether the domain name and interface of the web page to be embedded are consistent with the web page contained in the web page to be embedded; If yes, then replace the domain name and port of the web page to be embedded and the web pages contained in the web page to be embedded with the domain name and port of the web page to be embedded step by step from the inside to the outside according to the hierarchical structure corresponding to the web page to be embedded; If not, directly replace the domain name and port of the web page to be embedded and the web page contained in the web page to be embedded with the domain name and port of the embedded web page.
5. The method according to claim 1, characterized in that If it is determined that the login systems corresponding to the webpage to be embedded and the webpage to be embedded are different, the method further includes: Generate a prompt message to prompt the operator to re-execute the web page nesting operation.
6. The method according to claim 1, characterized in that The determining whether the login systems corresponding to the webpage to be embedded and the webpage to be embedded are the same includes: Loading the login page of the web page to be embedded and the login page of the embedded web page respectively; Determining whether the login page of the web page to be embedded and the login page of the embedded web page are similar pages; If yes, determining that the login system corresponding to the webpage to be embedded is the same as the login system corresponding to the webpage to be embedded; If not, it is determined that the login systems corresponding to the webpage to be embedded and the webpage to be embedded are different.
7. The method according to claim 6, characterized in that The determining whether the login page of the web page to be embedded and the login page of the embedded web page are similar pages comprises: Respectively extracting the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the embedded web page; Determine whether the unique resource locator corresponding to the login page of the web page to be embedded and the unique resource locator corresponding to the login page of the web page to be embedded meet a similarity rule, wherein the similarity rule is used to characterize a determination rule in which only a parameter part of the unique resource locator is different; If yes, determining that the login page of the web page to be embedded and the login page of the embedded web page are the similar pages; If not, it is determined that the login page of the web page to be embedded and the login page of the embedded web page are not the similar pages.
8. A web page nesting configuration device, characterized in that: The device comprises: A judgment unit, used to judge whether the login systems corresponding to the web page to be embedded and the web page to be embedded are the same when performing the web page nesting operation; A processing unit is used to replace the domain name and port corresponding to the web page to be embedded based on the domain name and port corresponding to the embedded web page if the judgment unit determines that the login system corresponding to the web page to be embedded is the same as that corresponding to the embedded web page. If the web page to be embedded and the embedded web page do not comply with the same-origin policy, so that the client can automatically perform a cross-domain login operation on the web page contained in the embedded web page based on the single sign-on operation on the embedded web page.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the webpage nesting configuration method according to any one of claims 1 to 7.
10. An electronic device, comprising at least one processor, and at least one memory and bus connected to the processor; wherein: The processor and the memory communicate with each other via the bus; The processor is used to call the program instructions in the memory to execute the web page nesting configuration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Web page cross-domain communication method and device
CN104301379A
Cross-domain IFRAME height self-adaption method
CN104391909A
Cross-domain processing method and system
CN107948329A
Multi-system SSO (single sign on) method and device
CN109246076A
Cross-domain single sign-on method and device, electronic equipment and storage medium
CN111209557A
