H5 page and host login state intercommunication method

By utilizing a mechanism for requesting tokens or keys on the front end to achieve seamless login state transfer and security verification between the H5 page and the host system, the problem of cross-system login state interoperability is solved, thus improving the user experience.

CN115145675BActive Publication Date: 2026-11-24LIAONING ZHENXING BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210842890.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-18
Publication Date
2026-11-24
Estimated Expiration
2042-07-18

AI Technical Summary

Technical Problem

In the case of a bank's APP and an external partner's H5 function, or an external partner's H5 function and the bank's own H5 function, the login status of the mobile APP and the H5 page cannot be communicated due to cross-system reasons. When users return to the APP after performing operations on the H5 page, the login status often expires and they need to log in again.

Method used

By adopting an H5 page and host login state interoperability method, the front end applies for a token or key before the redirect, and the back end allocates and maintains permissions. The front end and back end two-way verification mechanism is adjusted to ensure seamless transfer of user login state between different systems, including generating, verifying and maintaining login state.

Benefits of technology

It enables seamless transfer of user login status between different systems, avoids repeated logins, improves user experience, and prevents malicious tampering through security verification, making it suitable for various system scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115145675B_ABST
    Figure CN115145675B_ABST
Patent Text Reader

Abstract

This invention relates to the field of internet technology, specifically to a method for interoperability between an H5 page and a host login state. It establishes a standard for login-free transitions between a host app and H5, employing a mechanism where the front-end requests a token before the transition, the back-end allocates and maintains token permissions, and the front-end and back-end conduct secondary verification after adjustments. This ensures a seamless login experience for users while also providing security checks to prevent hijacking and malicious tampering. The login state standard and interaction method of this invention are applicable to any scenario requiring the embedding of H5 pages from different systems / manufacturers, offering broad applicability. It allows the host app and H5, while adhering to relevant standards, to ensure that users can directly transition between different host apps and H5 pages from other systems without login state failure or requiring secondary login. This breaks down the limitations of multiple different systems and significantly improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet technology, specifically to a method for interoperability between an H5 page and a host login state. Background Technology

[0002] Currently, most banks in the industry develop their apps using a hybrid native + H5 approach, but both methods rely on the same internal system within the bank for service.

[0003] When encountering a model of combining the bank's own APP with external partner H5 functionality or vice versa, the login states of the mobile APP and H5 page cannot be interconnected and shared due to cross-system issues. When users return to the mobile APP after performing operations on the H5 page for an extended period, their login state often expires, requiring them to log in again. Therefore, it is necessary to research a method for interoperability between the H5 page and the host login state. Summary of the Invention

[0004] Therefore, the purpose of this invention is to provide a method for interoperability between H5 pages and host login states. This method allows host apps and H5 pages to ensure that, while complying with relevant standards, users can directly jump between different host apps and H5 pages provided by other systems without experiencing login state failure or requiring users to log in a second time. This breaks through the limitations of multiple different systems and greatly improves the user experience.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is: a method for interoperability between an H5 page and a host login state, comprising the following steps; Step 1: The user initiates a login operation from the host. The host determines the user's current login status. If the user is not logged in, the page is redirected to the login page. If the user is already logged in, the host determines that the user has entered the login state and saves the user's login status. Step two: After confirming that the user has logged in, the host sends a request for an access key to the backend. Step 3: The backend system generates an access key. During the key generation process, the backend system first checks the input parameters to determine if they are valid. If valid, it assembles the business parameters, obtains the timestamp, generates a random value, and calculates the key using a hash function. The key is then saved. Step 4: After the key is generated, it returns to the host front-end, the host front-end returns to the host, and the host jumps to the H5 page to initiate access. At this time, the access is attached with a key. The key is valid only once and expires after one authentication. Step 5: After receiving the resource access request, the H5 page front-end first requests the verification key from the back-end system. During the verification process, the key is queried in the HASH table. If it can be found, the input parameters are compared. If the parameters match, the parameters are verified to be valid. If the verification is successful, the verification result is returned. If any of the following occurs: the parameter cannot be found, the parameter is inconsistent, or the parameter has expired, the key verification fails. The system processes the data based on the key verification result from the backend system. If the key is invalid, it returns an "access denied" message. If the key is valid, it checks whether the user is logged into the H5 page. If not, it performs a silent login and then returns the resource. Step 6: Maintain the login state by calling the session persistence interface.

[0006] Furthermore, the host is a mobile app, including the following steps; Step 1: The user initiates a login operation from the APP. The APP bank saves the user's login status and user session information in advance. Step two: The user initiates a request to access the H5 page from the app. The app checks if the user is already logged in. If not, it directly returns an error message indicating that the user is not authorized to access the page and requests to log in first. If the user is already logged in, it requests a ticket to access the H5 page from the backend system. Step 3: The backend system generates a ticket to access the H5 page and returns it to the front-end APP. The front-end APP returns to the APP, and the APP then initiates access. At this time, an additional ticket is attached to the access. The ticket is valid only once and expires after one authentication. Step 4: After receiving the resource access request, the H5 page first requests the backend system to verify the ticket and processes it according to the ticket verification result of the backend system. If the ticket is invalid, it directly returns that access is not authorized; if the ticket is valid, it checks whether the user is logged into the H5 page. If not, it performs a silent login and then returns the resource. Step 5: Maintain the APP's front-end session. The H5 page's front-end accesses the APP's native functions through JS code to maintain the session.

[0007] Furthermore, the host is WeChat Bank, which includes the following steps; Step 1: The user logs in from the user front end. If the user is not logged in, they are redirected to the login page. After the user logs in, the user information is queried in the channel section, and the cached WeChat token and user information are returned to the WeChat front end. Step 2: If the user logs in successfully or the user has already logged in in Step 1, the page will redirect to the H5 page's function page. This page is used to obtain the silent login authorization token-slient and obtain the silent login authorization token-slient from the backend after WeChat's pre-confirmation. Step 3: The backend returns the silent login authorization token-silent to the WeChat frontend. The WeChat frontend obtains the authorization token and redirects to the H5 page, which then sends the user's mobile phone number, WeChat token, and token-silent via a link. Step 4: Obtain the user's mobile phone number, WeChat token, and token-slient from the link on the H5 front end. The H5 front end obtains and verifies the token-slient, and then further verifies the token-slient in the back end. Step 5: If the verification fails, the link will be returned as invalid; if the verification succeeds, the user information will be queried in the background using the mobile phone number. After the result is found, the WeChat token will be stored as the key in the H5 front-end, and the user information will be buffered. The token and user information will be returned, and the silent login will be successful. Step 6: Periodically call the WeChat login renewal interface on the H5 frontend. The H5 frontend will then renew the WeChat login and continuously display the updated login information.

[0008] Furthermore, the host requests an access ticket from the backend system and passes the ticket to the H5 page frontend via the access link provided on the H5 page. After triggering the link access, the H5 page frontend checks if the link carries an access ticket. If so, it calls the backend system to verify the ticket. If valid, the frontend retrieves the login status information from the backend system, performs a silent login, generates a token, and caches it in Redis. Simultaneously, it returns a valid identifier and token to the frontend. The frontend caches the token and enters the page normally. At the same time, a timer is started, which periodically calls the mobile banking app via JsBridge to refresh the mobile banking login status. If invalid, it directly returns an invalid identifier to the frontend, and the page then enters an error page.

[0009] Furthermore, after the H5 page frontend triggers a link access, if the link does not carry an access ticket, it checks the frontend's local cache to see if a token exists. If not, it directly enters the error page; if it exists, it takes the token to the frontend to check the login validity. If invalid, it returns an invalid flag to the frontend, causing the frontend to redirect to the error page. If valid, the frontend processes the frontend's request and response normally.

[0010] Furthermore, the input parameters include RequestChannelNo, RequestAppId, and ResourceAppId.

[0011] The beneficial effects of the above technical solution are as follows: This invention establishes a standard for login-free transitions between the host APP and H5, adopting a mechanism where the front-end applies for a token before the transition, the back-end allocates and maintains token permissions, and the front-end and back-end conduct secondary verification after adjustments. This not only ensures the customer's experience of not needing to log in twice, but also provides security verification from a technical perspective, preventing hijacking and malicious tampering. It overcomes the contradiction between different manufacturers or systems requiring customers to log in for security reasons, but the existence of different login systems among various manufacturers / systems. The login state standard and interaction method of this invention are applicable to any scenario that needs to embed H5 pages provided by different systems / manufacturers, with a wide range of applications. It allows the host APP and H5 to ensure that, while complying with relevant standards, users can directly jump between different host APPs and H5 pages provided by other systems without login state failure or requiring users to log in twice. This breaks the limitations of multiple different systems and greatly improves the user experience. Attached Figure Description

[0012] Figure 1 Flowchart for the interoperability between a mobile app as a host and an H5 page login state; Figure 2 Flowchart for the seamless login process of WeChat Bank as the host entering the H5 page; Figure 3 Generate a flowchart of the steps for generating a ticket; Figure 4 This is a flowchart of the ticket verification process. Detailed Implementation

[0013] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments: Example 1 aims to provide a method for interoperability between H5 pages and host login states. This method primarily addresses the interoperability of login states between the host app and H5 pages. Existing bank apps are typically developed using a hybrid native + H5 model, but both are provided by the same system within the same bank. When encountering a scenario where the bank's app integrates with another bank's H5 functionality or vice versa, the login states of the mobile app and H5 page cannot be interoperated and shared due to cross-system limitations. When users return to the mobile app after prolonged interaction on the H5 page, their login state often expires, requiring them to log in again. This example allows the host app and H5 page to, while adhering to relevant standards, ensure that users can directly navigate between different host apps and H5 pages provided by other systems without experiencing login state expiration or requiring secondary login. This overcomes the limitations of multiple different systems and significantly improves the user experience.

[0014] In this embodiment, the H5 page is a mobile webpage implemented using a series of web technologies. It can provide complete functionality independently, be used alone, or be embedded in hosts such as mobile banking or WeChat banking. Login state: Regular HTTP requests are stateless and cannot record or distinguish users. Therefore, the login state is used to distinguish users, letting the server know who sent each request session and who needs to process it.

[0015] This embodiment discloses a method for interoperability between an H5 page and a host login state, including the following steps; Step 1: The user initiates a login operation from the host. The host determines the user's current login status. If the user is not logged in, the page is redirected to the login page. If the user is already logged in, the host determines that the user has entered the login state and saves the user's login state. This step is mainly used to implement user login to the host. Step two: After confirming that the user has logged in, the host sends a request for an access key to the backend. Step 3: The backend system generates an access key. During the key generation process, the backend system first checks the input parameters, which include RequestChannelNo, RequestAppId, and ResourceAppId. It then determines whether the input parameters are valid. If valid, it assembles the business parameters, obtains the timestamp, generates a random value, and calculates the key using a hash function. The key is then saved.

[0016] The ticket generation step in this process is as follows: 1. The RequestChannelNo, RequestAppId, and ResourceAppId parameters in the request need to be verified. If the relevant parameters are not configured in the ticket configuration table, the verification will fail and the result will be returned directly. 2. The specific parameter rule for generating tikcet is RequestChannelNo + RequestAppId + ResourceAppId + OpenId + timestamp + salt, and then hashed.

[0017] Step 4: After the key is generated, it returns to the host front end, the host front end returns to the host, and the host jumps to the H5 page to initiate access. At this time, the access is attached with a key. The key is valid only once and expires after one authentication. Step 5: After receiving the resource access request, the H5 page front-end first requests the verification key from the back-end system. During the verification process, the key is queried in the HASH table. If it can be found, the input parameters are compared. If the parameters match, the parameters are verified to be valid. If the verification is successful, the verification result is returned. If any of the following occurs: the parameter cannot be found, the parameter is inconsistent, or the parameter has expired, the key verification fails. Ticket verification steps: 1. The RequestChannelNo, RequestAppId, ResourceAppId, and OpenId parameters in the request are used to query the ticket. If the ticket cannot be found, it will be returned as invalid.

[0018] 2. Compare the input parameters with the parameters passed to the database; if they are inconsistent, return a validation failure directly.

[0019] 3. Check if the ticket is valid. If it is not valid, return that the ticket is invalid.

[0020] The system processes the data based on the key verification result from the backend system. If the key is invalid, it returns an "access denied" message. If the key is valid, it checks whether the user is logged into the H5 page. If not, it performs a silent login and then returns the resource. Step 6: Maintain the login state by calling the session persistence interface.

[0021] This invention establishes a standard for login-free transitions between host apps and H5 pages. It employs a mechanism where the front-end requests a token before the transition, the back-end allocates and maintains token permissions, and the front-end and back-end conduct secondary verification after adjustments. This ensures a seamless login experience for customers while also providing security checks to prevent hijacking and malicious tampering. It overcomes the inconsistencies between different manufacturers' or systems that require login for security reasons. The standard login state and interaction methods are applicable to any scenario requiring the embedding of H5 pages from different systems / manufacturers, offering broad applicability. It ensures that, while adhering to relevant standards, users can seamlessly transition between different host apps and H5 pages from other systems without login failures or the need for secondary logins. This breaks down the limitations of multiple systems and significantly improves the user experience.

[0022] Example 2: Based on the basic concept in Example 1, this example designates the host as mobile banking.

[0023] In this embodiment, "mobile banking APP" is a general term, mainly referring to software installed on smartphones that provides users with a variety of rich banking functions; the implementation includes the following steps; Step 1: The user initiates a login operation from the APP. The APP bank saves the user's login status and user session information in advance. Step two: The user initiates a request to access the H5 page from the app. The app checks if the user is already logged in. If not, it directly returns an error message indicating that the user is not authorized to access the page and requests to log in first. If the user is already logged in, it requests a ticket to access the H5 page from the backend system. Step 3: The backend system generates a ticket to access the H5 page and returns it to the front-end APP. The front-end APP returns to the APP, and the APP then initiates access. At this time, an additional ticket is attached to the access. The ticket is valid only once and expires after one authentication. Step 4: After receiving the resource access request, the H5 page first requests the backend system to verify the ticket and processes it according to the ticket verification result of the backend system. If the ticket is invalid, it directly returns that access is not authorized; if the ticket is valid, it checks whether the user is logged into the H5 page. If not, it performs a silent login and then returns the resource. Step 5: Maintain the APP's front-end session. The H5 page's front-end accesses the APP's native functions through JS code to maintain the session.

[0024] This embodiment uses a mobile banking app as an example. After determining that the user is logged in, it requests a ticket to access the H5 page from the backend system. The backend system generates the ticket and returns it to the frontend app. The app attaches the ticket and sends an access request to the H5 page. After receiving the resource access request, the H5 page first requests the backend system to verify the ticket and processes it according to the ticket verification result of the backend system. It adopts a mechanism in which the frontend requests the ticket before the redirect, the backend allocates and maintains the ticket permissions, and the frontend and backend perform two verifications after the adjustment. This not only ensures the customer's experience of not having to log in twice, but also provides security verification from a technical perspective to prevent the occurrence of hijacking and malicious tampering.

[0025] Example 3 further illustrates the solution in Example 1; in this example, the host is WeChat Bank, which relies on the application account provided by the WeChat Official Account to provide users with a variety of rich banking functions.

[0026] In practice, the following steps are included; Step 1: The user logs in from the user front end. If the user is not logged in, they are redirected to the login page. After the user logs in, the user information is queried in the channel section, and the cached WeChat token and user information are returned to the WeChat front end. Step 2: If the user logs in successfully or the user has already logged in in Step 1, the page will redirect to the H5 page's function page. This page is used to obtain the silent login authorization token-slient and obtain the silent login authorization token-slient from the backend after WeChat's pre-confirmation. Step 3: The backend returns the silent login authorization token-silent to the WeChat frontend. The WeChat frontend obtains the authorization token and redirects to the H5 page, which then sends the user's mobile phone number, WeChat token, and token-silent via a link. Step 4: Obtain the user's mobile phone number, WeChat token, and token-slient from the link on the H5 front end. The H5 front end obtains and verifies the token-slient, and then further verifies the token-slient in the back end. Step 5: If the verification fails, the link will be returned as invalid; if the verification succeeds, the user information will be queried in the background using the mobile phone number. After the result is found, the WeChat token will be stored as the key in the H5 front-end, and the user information will be buffered. The token and user information will be returned, and the silent login will be successful. Step 6: Periodically call the WeChat login renewal interface on the H5 frontend. The H5 frontend will then renew the WeChat login and continuously display the updated login information.

[0027] In this embodiment, the host requests an access ticket from the backend system and passes the ticket to the H5 page frontend via an access link provided on the H5 page. After triggering the link access, the H5 page frontend checks if the link carries an access ticket. If so, it calls the backend system to verify the ticket. If valid, the frontend retrieves login status information from the backend system, performs a silent login, generates a token, and caches it in Redis. Simultaneously, it returns a valid identifier and token to the frontend. The frontend caches the token and enters the page normally. At the same time, a timer is started, which periodically calls the mobile banking app via JsBridge to refresh the mobile banking login status. If invalid, an invalid identifier is directly returned to the frontend, and the page redirects to an error page.

[0028] When an H5 page triggers a link access, if the link does not carry an access ticket, the front-end checks its local cache to see if a token exists. If not, it directly redirects to an error page. If the token exists, it is sent to the front-end to check the login validity. If invalid, an invalid flag is returned to the front-end, causing the front-end to redirect to the error page. If valid, the front-end processes the request and response normally.

Claims

1. A method for interoperability between an H5 page and a host login state, characterized in that, Includes the following steps; Step 1: The user initiates a login operation from the host. The host determines the user's current login status. If the user is not logged in, the page is redirected to the login page. If the user is already logged in, the host determines that the user has entered the login state and saves the user's login status. Step two: After confirming that the user has logged in, the host sends a request for an access key to the backend. Step 3: The backend system generates an access key. During the key generation process, the backend system first checks the input parameters to determine if they are valid. If valid, it assembles the business parameters, obtains the timestamp, generates a random value, and calculates the key using a hash function. The key is then saved. The input parameters include RequestChannelNo, RequestAppId, and ResourceAppId. Step 4: After the key is generated, it returns to the host front-end, the host front-end returns to the host, and the host jumps to the H5 page to initiate access. At this time, the access is attached with a key. The key is valid only once and expires after one authentication. Step 5: After receiving the resource access request, the H5 page front-end first requests the verification key from the back-end system. During the verification process, the key is queried in the HASH table. If it can be found, the input parameters are compared. If the parameters match, the parameters are verified to be valid. If the verification is successful, the verification result is returned. If any of the following occurs: the parameter cannot be found, the parameter is inconsistent, or the parameter has expired, the key verification fails. The system processes the data based on the key verification result from the backend system. If the key is invalid, it returns an "access denied" message. If the key is valid, it checks whether the user is logged into the H5 page. If not, it performs a silent login and then returns the resource. Step 6: Maintain the login state by calling the session persistence interface; The host requests an access ticket from the backend system and passes the ticket to the H5 page frontend via the access link provided on the H5 page. Upon triggering the link access, the H5 page frontend checks if the link contains an access ticket. If so, it calls the backend system to verify the ticket. If valid, the frontend retrieves login status information from the backend system, performs a silent login, generates a token, and caches it in Redis. Simultaneously, it returns a valid identifier and token to the frontend. The frontend, with its cached token, successfully enters the page and starts a timer. This timer periodically calls the mobile banking app via JsBridge to refresh the mobile banking login status. If invalid, it directly returns an invalid identifier to the frontend, and the page redirects to an error page.

2. The method for interoperability between an H5 page and the host login state according to claim 1, characterized in that: The host is a mobile app, and the steps include the following; Step 1: The user initiates a login operation from the APP. The APP bank saves the user's login status and user session information in advance. Step 2: The user initiates a request to access the H5 page from the APP. The APP determines whether the user is already logged in. If not, it directly returns an error message indicating that the user is not authorized to access the page and asks the user to log in first. If the user is already logged in, the APP requests a ticket to access the H5 page from the backend system. Step 3: The backend system generates a ticket to access the H5 page and returns it to the front-end APP. The front-end APP returns to the APP, and the APP then initiates access. At this time, an additional ticket is attached to the access. The ticket is valid only once and expires after one authentication. Step 4: After receiving the resource access request, the H5 page first requests the backend system to verify the ticket and processes it according to the ticket verification result of the backend system. If the ticket is invalid, it directly returns that access is not authorized; if the ticket is valid, it checks whether the user is logged into the H5 page. If not, it performs a silent login and then returns the resource. Step 5: Maintain the APP's front-end session. The H5 page's front-end accesses the APP's native functions through JS code to maintain the session.

3. The method for interoperability between an H5 page and the host login state according to claim 1, characterized in that: The host is WeChat Banking, and the steps are as follows; Step 1: The user logs in from the user front end. If the user is not logged in, they are redirected to the login page. After the user logs in, the user information is queried in the channel section, and the cached WeChat token and user information are returned to the WeChat front end. Step 2: If the user logs in successfully or the user has already logged in in Step 1, the page will redirect to the H5 page's function page. This page is used to obtain the silent login authorization token-slient and obtain the silent login authorization token-slient from the backend after WeChat's pre-confirmation. Step 3: The backend returns the silent login authorization token-silent to the WeChat frontend. The WeChat frontend obtains the authorization token and redirects to the H5 page, which then sends the user's mobile phone number, WeChat token, and token-silent via a link. Step 4: Obtain the user's mobile phone number, WeChat token, and token-slient from the link on the H5 front end. The H5 front end obtains and verifies the token-slient, and then further verifies the token-slient in the back end. Step 5: If the verification fails, the link will be returned as invalid; if the verification succeeds, the user information will be queried in the background using the mobile phone number. After the result is found, the WeChat token will be stored as the key in the H5 front-end, and the user information will be buffered. The token and user information will be returned, and the silent login will be successful. Step 6: Periodically call the WeChat login renewal interface on the H5 frontend. The H5 frontend will then renew the WeChat login and continuously display the updated login information.

4. The method for interoperability between an H5 page and the host login state according to any one of claims 1-3, characterized in that: When an H5 page triggers a link access, if the link does not carry an access ticket, the front-end will check the local cache of the front-end to see if a token exists. If not, it will directly enter the error page. If the token exists, it will be sent to the front-end to check the login validity. If it is invalid, an invalid flag will be returned to the front-end, and the front-end will be redirected to an error page. If it is valid, the front-end request and response will be processed normally.

Citation Information

Patent Citations

  • Login state synchronization method and device and storage medium

    CN112491861A

  • Page jumping method, system and device

    CN113312576A