Applet password-free login method, device, equipment, storage medium and program product
By generating and verifying pre-fetching requests and authorization trace requests for mini-program signatures, combined with local encrypted storage and user-visible authorization pages, the problems of unauthorized API calls and information security in mini-program passwordless login are solved, achieving higher security and user experience.
Patent Information
- Application Number
- CN202410822369.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing passwordless login solutions for mini-programs have issues with unauthorized API calls and poor user information security. Attackers can analyze the JSSDK request format and parameters to initiate pre-retrieval requests to obtain users' mobile phone numbers, and the login authorization page nested in iframes is easily hidden or covered.
A number retrieval request is generated by obtaining the plugin's pre-retrieval API and the mini-program's signature. The operator verifies the request source and encrypts and stores the access code locally. The user authorization page is invoked, and an authorization trace request is generated in response to the user's authorization. A security token is obtained, and login is completed based on the access code and token. This ensures that the interface can only be accessed by the mini-program plugin, prevents unauthorized calls, and provides an authorization page visible to the user.
This enhances the security of passwordless login for mini-programs, prevents unauthorized API calls, ensures users can view the authorization page and complete one-click login, and protects user information security.
Smart Images

Figure CN118842618B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a mini-program password-free login method and device, equipment, storage medium and program product. BACKGROUND
[0002] A mini-program is a lightweight application that can be used without downloading and installing, usually embedded in a certain platform and running. They are developed through the framework and interface provided by the platform, and users can quickly access and use mini-programs through scanning a two-dimensional code, searching, sharing, and other ways. Mini-programs are suitable for various scenarios and needs due to their lightweight, convenience, and efficiency. In the current mini-program scenario, a mini-program application realizes the acquisition and verification of a mobile phone number by integrating an operator JavaScript software development kit (JSSDK) package, thereby realizing password-free login. After a user enters the login page of a mini-program, the mini-program application initiates a password-free login pre-number request through the operator JSSDK, receives the access code (accesscode) and mobile phone mask information returned by the operator service, and then the operator JSSDK is responsible for pulling up the login authorization page and displaying the mobile phone mask information. After the user selects to authorize login, the mini-program application obtains the accesscode from the operator JSSDK and initiates a login request to the application backend service, and the mini-program application backend service replaces the mobile phone number from the operator backend service through the accesscode, and completes the entire login process after successful replacement.
[0003] However, in this process, the JSSDK is easy to be obtained and analyzed, and if an attacker analyzes the format and parameters of the JSSDK pre-number request, the attacker can initiate a pre-number request without integrating the SDK, thereby the existing mini-program password-free login scheme has the risk of an Application Programming Interface (API) being illegally called, and after the attacker initiates a pre-number request and obtains the return result, the attacker can not display the user authorization page, and obtains the device mobile phone number without the user's knowledge. From another perspective, in the existing mini-program, the login authorization page provided by the JSSDK is added to the mini-program page for display through an inline frame nesting (iframe nesting) method, and the attacker can also use the characteristics of iframe to induce the user to click the confirmation authorization button through means such as hiding display, covering other pages, and click interception, thereby causing the user to unknowingly have the device mobile phone number obtained by the attacker. Therefore, the security of the existing mini-program password-free login scheme needs to be improved. SUMMARY
[0004] The application provides a mini-program password-free login method and device, equipment, storage medium and program product, to solve the problem that the existing mini-program password-free login technology is easy to be intercepted by attackers to obtain user information, and the security is poor.
[0005] In a first aspect, the application provides a mini-program password-free login method, comprising:
[0006] Obtaining a plug-in pre-number application programming interface (API) and a mini-program signature, generating a pre-number request based on the plug-in pre-number API and the mini-program signature, and sending the pre-number request to an operator end, wherein the mini-program signature is used to verify the source of the plug-in pre-number API;
[0007] Obtaining an access code and a mobile phone mask code fed back by the operator end, locally encrypting and storing the access code, and arousing a user authorization page based on the plug-in pre-number API, wherein the user authorization page includes the mobile phone mask code, and the mobile phone mask code is used for user confirmation of authorization information;
[0008] In response to an instruction of user agreement authorization, obtaining the access code from local decryption, generating an authorization trace request according to the access code and the mini-program signature, sending the authorization trace request to the operator end, and obtaining a security token;
[0009] Arouse a login page based on the access code and the security token, and in response to a login operation instruction of the user, generate a mobile phone number substitution request according to the access code and the security token, send the mobile phone number substitution request to the operator end, obtain a user mobile phone number, complete login, and the access code and the security token are used for number substitution verification, and the operator end returns the user mobile phone number after verification.
[0010] Optionally, the method as described above, wherein the obtaining of the plug-in pre-number application programming interface (API) and the mini-program signature comprises:
[0011] Obtaining a request parameter and a host token of the mini-program, wherein the request parameter includes the plug-in pre-number API and an AppID of the mini-program;
[0012] According to the request parameter and the host token, a signature string is constructed according to a preset rule, and the mini-program signature is obtained by encrypting the signature string.
[0013] Optionally, the method as described above, before the sending of the pre-number request to the operator end, further comprising:
[0014] Detecting a network connection state, wherein the network connection state includes a cellular network connection, a wireless network connection, and a dual network connection;
[0015] Switching the network connection state to the cellular network connection.
[0016] Optionally, the method as described above, the user authorization page is invoked based on the plug-in pre-take number API, comprising:
[0017] The pre-take number result is returned through an API callback function;
[0018] When the pre-take number result is successful, a preset user authorization page is invoked, and the mobile phone mask is filled into a target column of the user authorization page.
[0019] Optionally, the method as described above, after the user authorization page is invoked based on the plug-in pre-take number API, further comprising:
[0020] When the pre-take number result is failed or a user sends an instruction to modify the mobile phone mask, a preset user-defined login page is invoked, and the user-defined login page provides a mobile phone number input column or an account number input column.
[0021] Optionally, the method as described above, in the step of sending the authorization trace request to the operator end to obtain a security token, the operator end is used to check the mini-program signature, and a security token is generated after the check is passed, the security token is associated with the access code at the operator end, and the security token includes a time stamp.
[0022] Optionally, the method as described above, the specific steps of using the access code and the security token to perform number substitution check are implemented by the operator end, comprising:
[0023] The association between the access code and the security token is checked;
[0024] If the check is passed, it is judged whether the time interval between the sending and the feedback of the security token is not more than a first preset value;
[0025] If yes, it is confirmed that the check is passed;
[0026] If no, it is confirmed that the check is not passed.
[0027] In a second aspect, the application provides a mini-program password-free login device, comprising:
[0028] A pre-take number module is used to obtain a plug-in pre-take number application programming interface (API) and a mini-program signature, generate a pre-take number request based on the plug-in pre-take number API and the mini-program signature, send the pre-take number request to an operator end, and the mini-program signature is used to verify the source of the plug-in pre-take number API;
[0029] The authorization module is configured to obtain an access code and a mobile phone mask code fed back by an operator, locally encrypt and store the access code, and arouse a user authorization page based on the plug-in pre-fetching number API, wherein the user authorization page comprises the mobile phone mask code, and the mobile phone mask code is used for user confirmation of authorization information.
[0030] The authorization trace module is configured to, in response to an instruction of user agreement authorization, obtain the access code from local decryption, generate an authorization trace request according to the access code and the applet signature, send the authorization trace request to the operator side, and obtain a security token.
[0031] The login module is configured to arouse a login page based on the access code and the security token, generate a mobile phone number substitution request according to the access code and the security token in response to a login operation instruction of a user, send the mobile phone number substitution request to the operator side, obtain a user mobile phone number, complete login, and use the access code and the security token for number substitution verification, wherein the operator side feeds back the user mobile phone number after verification.
[0032] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-executable instructions to implement the mini-program password-free login method of any one of the first aspect.
[0033] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the mini-program password-free login method of any one of the first aspect.
[0034] In a fifth aspect, the present application provides a computer program product, wherein when the computer program product is executed on a terminal device, the terminal device executes the mini-program password-free login method of any one of the first aspect.
[0035] The application provides a mini-program password-free login method, device, equipment, storage medium and program product. The mini-program password-free login method comprises the following steps: obtaining a plug-in pre-number application programming interface (API) and a mini-program signature, generating a pre-number request based on the plug-in pre-number API and the mini-program signature, sending the pre-number request to an operator end, and using the mini-program signature to verify the source of the plug-in pre-number API; obtaining an access code and a mobile phone mask code fed back by the operator end, locally encrypting and storing the access code, arousing a user authorization page based on the plug-in pre-number API, wherein the user authorization page comprises the mobile phone mask code, and the mobile phone mask code is used for user confirmation of authorization information; in response to an instruction that the user agrees to authorization, obtaining the access code by local decryption, generating a authorization trace request according to the access code and the mini-program signature, sending the authorization trace request to the operator end, and obtaining a security token; arousing a login page based on the access code and the security token, and in response to a login operation instruction of the user, generating a mobile phone number substitution request according to the access code and the security token, sending the mobile phone number substitution request to the operator end, obtaining a user mobile phone number, completing login, and using the access code and the security token to perform number substitution verification, wherein the operator end returns the user mobile phone number after the verification is passed, the mini-program signature is used to realize verification of the operator end on the source of a network request from a mini-program plug-in, the pre-number and the authorization trace interface can only be accessed by the mini-program plug-in, the interface is prevented from being illegally called, the user authorization login page provided by the mini-program plug-in completes the authorization trace, the authorization trace API call can only be completed by the page, the mini-program application cannot hide, cover or click intercept the page displayed by the plug-in, the user can normally view the authorization page to complete one-key login, and the security of user information is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0036] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0037] Figure 1 It is an interaction diagram of the mini-program password-free login method in the prior art.
[0038] Figure 2 It is an interaction diagram of the mini-program password-free login method provided by the embodiment of the application.
[0039] Figure 3 It is a flowchart of the mini-program password-free login method provided by the embodiment of the application.
[0040] Figure 4 It is a schematic diagram of the mini-program password-free login device provided by the embodiment of the application.
[0041] Figure 5A structural schematic diagram of an electronic device for implementing the method for password-free login of a small application provided in the embodiments of the present application is shown.
[0042] The specific embodiments of the present application have been shown in the above-described drawings, and will be described in more detail hereinafter. These drawings and the written description are not intended to restrict the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0043] The exemplary embodiments will be described in detail herein with reference to the accompanying drawings. The following description is presented with reference to the drawings to explain the concept of the present application. The same reference numerals in different drawings represent the same or similar elements unless otherwise indicated.
[0044] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of the relevant data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for the user to choose authorization or refusal.
[0045] In the related art, as shown in Figure 1 Figure 1 The present application is a method for password-free login of a small application in the prior art, and the small application application realizes password-free login by integrating an operator JavaScript software development kit (JSSDK) package to obtain and verify a mobile phone number. After a user enters the login page of the small application, the small application application initiates a password-free login pre-fetching number request through the operator JSSDK, receives an access code (accesscode) and mobile phone mask information returned by the operator service, and then the operator JSSDK is responsible for pulling up a login authorization page and displaying the mobile phone mask information. After the user selects to authorize login, the small application application obtains the accesscode from the operator JSSDK and initiates a login request to the application backend service, and the small application application backend service replaces the mobile phone number from the operator backend service through the accesscode, and completes the entire login process after the replacement is successful.
[0046] To address the aforementioned technical issues, this application aims to propose a method, apparatus, device, storage medium, and program product for passwordless login in mini-programs. The main concept of this method is as follows: the mini-program plugin utilizes the signature information carried in the network requests of the host App container to enable the server to verify that the network requests originate from the mini-program plugin. This ensures that the pre-fetching number and authorization trace interfaces can only be accessed by the mini-program plugin, preventing unauthorized calls to the interfaces. Furthermore, the user authorization login page provided by the mini-program plugin completes authorization traces. The plugin utilizes the page permission management mechanism and request signature information provided by the host App container to ensure that authorization trace API calls can only be completed by this page. The mini-program application cannot hide, cover, or intercept clicks on the page displayed by the plugin, ensuring that users can normally view the authorization page and complete one-click login. Further, the mini-program plugin also utilizes the host App container to implement forced switching between cellular networks, avoiding the problem of pre-fetching number failure under dual-network conditions with traditional JSSDKs. Moreover, local data encryption storage is achieved through the host App container, further improving overall security.
[0047] To better understand the solutions of the embodiments of this application, an application scenario involved in the embodiments of this application will be introduced below.
[0048] Please see Figure 2 , Figure 2 This is an interactive diagram illustrating the passwordless login method for mini-programs provided in this application embodiment, as shown below. Figure 2 As shown, the system includes a mini-program application 100 and a carrier terminal 200. The mini-program application 100 is embedded in the host app. Specifically, the mini-program application 100 may include a mini-program front-end, a mini-program plugin, and a mini-program back-end. The mini-program application 100 receives a user's login trigger and sends a relevant request to the carrier terminal 200 carrying signature information. Specifically, this may include three stages: number pre-retrieval, authorization record keeping, and number replacement.
[0049] (1) Pre-number selection stage:
[0050] The user triggers the login operation;
[0051] The mini-program front-end calls the mini-program plugin pre-fetching API;
[0052] When a mini-program plugin initiates a number retrieval network request, it utilizes the host's request API (such as the wx.request API) to force the use of cellular network for the request under dual-network conditions. Additionally, when the mini-program plugin initiates this request, the host app will include a signature to verify that the request originates from the mini-program plugin. The server-side interface verifies this signature, restricting only mini-program plugins to initiating this API call.
[0053] The service end interface service first verifies the request signature information, and after verification, performs a pre-number operation through cellular network information to generate a verification code;
[0054] The service end interface returns the pre-number result, the verification code, and the mobile phone mask information;
[0055] After receiving the response, the applet plugin stores the pre-number verification code in local encryption by using the request API provided by the host, and the host App ensures that only the plugin itself can read the data;
[0056] The applet plugin returns the pre-number result and the mobile phone mask information through the API callback method, and to ensure security, the verification code information will not be returned in the callback.
[0057] (2) Authorization trace stage:
[0058] After receiving the pre-number result, the applet front end can perform page jumping according to the result, and when the pre-number is successful, the user authorization login page provided by the applet plugin is invoked, and when the pre-number fails, the application's own login page (mobile phone verification code login or account password login page, etc.) is opened;
[0059] The applet plugin displays the user authorization login page, and shows the mobile phone mask, user agreement, one-click login button, etc.
[0060] The user checks the authorization agreement and clicks the one-click login button;
[0061] The applet plugin reads data from the local storage and decrypts the verification code by using the request API provided by the host, and the host App ensures that only the plugin itself can read the data;
[0062] The applet plugin initiates an authorization trace network request and carries the verification code information. When the applet plugin initiates an authorization trace network request by using the request API provided by the host App, the host App will additionally carry a signature information, which is used to verify that the request originates from the applet plugin. The service end interface will verify the signature to limit that only the applet plugin can initiate the call of the interface;
[0063] The service end interface service first verifies the request signature information, and after verification, records the authorization trace information, generates a security token, and associates the verification code with the security token. The verification code that has been associated cannot be used again;
[0064] The service end interface returns the security token;
[0065] After receiving the response, the applet plugin will jump to the specified page of the applet front end, and pass the verification code and the security token as page parameters.
[0066] (3) Number substitution stage:
[0067] The applet front end initiates a login request to the application service end, carrying the verification code and security token information;
[0068] After receiving the request, the application service end initiates a number substitution request to the operator service end, carrying the verification code and security token information;
[0069] After receiving the request, the service end verifies whether the verification code and security token are associated, whether the use validity period is exceeded, etc., and substitutes the mobile phone number after verification;
[0070] The service end interface returns the mobile phone number information;
[0071] The application service end receives the response to obtain the mobile phone number, completes the subsequent login operation, and returns the login result.
[0072] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0073] Figure 3 The flowchart of the mini-program password-free login method provided by the embodiments of the present application is shown in FIG. 1. Figure 3 As shown in the figure, the method of the present embodiment comprises:
[0074] S301: Obtain a plug-in pre-fetch number application programming interface (API) and a mini-program signature, generate a pre-fetch number request based on the plug-in pre-fetch number API and the mini-program signature, and send the pre-fetch number request to an operator end, wherein the mini-program signature is used to verify the source of the plug-in pre-fetch number API.
[0075] The execution subject of the embodiments of the present application can be a mini-program application, wherein the mini-program application is embedded in a host App.
[0076] It can be understood that an API is a set of definitions and protocols for building and integrating software applications. API allows communication and data exchange between different software systems. The mini-program application can use the network request interface provided by the host App to initiate an HTTP request to the server. For example, wx.request is a network request interface in the host mini-program, which is used to initiate an HTTP request to the server in the mini-program. Through wx.request, developers can implement data interaction with the backend server in the mini-program, such as data acquisition, form submission, file upload, etc.
[0077] In this embodiment, the applet plug-in also carries a signature information when initiating the pre-fetch number request, i.e., the applet signature, which can be used to verify that the request originates from the applet plug-in. The pre-fetch number request is sent to the server of the operator end, and the server interface verifies the signature to limit that only the applet plug-in can initiate the call of the interface.
[0078] S302: Obtain the access code and the mobile phone mask code fed back by the operator end, locally encrypt the access code, call the user authorization page based on the plug-in pre-fetch number API, and the user authorization page includes the mobile phone mask code, which is used for user confirmation of authorization information.
[0079] In this step, the access code is a code used for identity verification, authorization or access to specific resources. After receiving the response, the applet application can locally encrypt the pre-fetch number access code using the API provided by the host App, so as to ensure that only the plug-in itself can read the data by using the host App.
[0080] S303: In response to the instruction of user agreement authorization, obtain the access code from local decryption, generate an authorization footprint request according to the access code and the applet signature, send the authorization footprint request to the operator end, and obtain a security token.
[0081] It can be understood that the security token sent by the operator refers to a security token used for identity verification and authorization. Such a token can ensure the identity of the user and allow the user to access specific services or resources. For example, the security token can be an identity verification token used to verify the identity of the user, ensuring that the user is legitimate, that is, when the user logs in to a certain service, the server generates a token and sends it to the user, and the user carries this token in subsequent requests to prove his identity. The security token is usually generated by the operator or service provider and sent to the user in a secure manner (such as encryption) to ensure its security and uniqueness. The use of security tokens can significantly improve the security of the system, preventing unauthorized access and operation.
[0082] S304: Call the login page based on the access code and the security token, and in response to the login operation instruction of the user, generate a mobile phone number substitution request according to the access code and the security token, send the mobile phone number substitution request to the operator end, obtain the user's mobile phone number, complete the login, and the access code and the security token are used for number substitution verification. After the verification is passed, the operator end returns the user's mobile phone number.
[0083] In this step, after receiving the login instruction, the applet application initiates a number substitution request to the operator end carrying the access code and the security token. The operator verifies the access code and the security token, substitutes the mobile phone number after verification, so that the applet application can obtain the mobile phone number, complete the subsequent login operation, and return the login result.
[0084] The applet password-free login method provided in this embodiment acquires a plugin pre-fetching number application programming interface (API) and an applet signature, generates a pre-fetching number request based on the plugin pre-fetching number API and the applet signature, and sends the pre-fetching number request to the operator end. The applet signature is used to verify the source of the plugin pre-fetching number API. The access code and the mobile phone mask fed back by the operator end are acquired, the access code is locally encrypted and stored, a user authorization page is invoked based on the plugin pre-fetching number API, the user authorization page includes the mobile phone mask, and the mobile phone mask is used for user confirmation of authorization information. In response to an instruction of user authorization agreement, the access code is acquired by local decryption, a authorization trace request is generated based on the access code and the applet signature, the authorization trace request is sent to the operator end, a security token is acquired, a login page is invoked based on the access code and the security token, and in response to a login operation instruction of the user, a mobile phone number substitution request is generated based on the access code and the security token, the mobile phone number substitution request is sent to the operator end, the user mobile phone number is obtained, the login is completed, the access code and the security token are used for number substitution verification, and the user mobile phone number is returned by the operator end after verification. The verification of the network request source from the applet plugin by the operator end is realized through the applet signature, it is ensured that the pre-fetching number and the authorization trace interface can only be accessed by the applet plugin, the interface is prevented from being illegally called, the user authorization login page provided by the applet plugin completes the authorization trace, it is ensured that the authorization trace API call can only be completed by the page, the applet application cannot hide, cover, and click intercept the page displayed by the plugin, it is ensured that the user can normally view the authorization page to complete one-key login, and the security of user information is ensured.
[0085] The technical solutions of the applet password-free login method are described in detail below.
[0086] In a possible implementation, the applet password-free login method provided in this embodiment acquires the request parameters of the applet and generates signature information of the applet.
[0087] Specifically, the plugin pre-fetching number application programming interface (API) and the applet signature are acquired, including: acquiring the request parameters of the applet and a host token, the request parameters including the plugin pre-fetching number API and the AppID of the applet; constructing a signature string according to the request parameters and the host token according to a preset rule, and encrypting the signature string to obtain the applet signature.
[0088] It can be understood that the request parameters of the applet can include a unique identifier AppID of the applet, a timestamp TIMESTAMP of the current time, and a random string NONCESTR, etc. The host token, that is, the Token of the host App, can be found in the basic settings of the applet plug-in. The Token is known only to the applet plug-in developer and the plug-in server developer, and is used to ensure the security of signature calculation.
[0089] For example, the preset calculation rule can be SIGNATURE=sha1([APPID, NONCESTR, TIMESTAMP, TOKEN].sort().join(”)) that is, the above four parameters are placed in this array, the elements of the array are connected into a signature string after sorting, and the signature string can be subjected to a hash operation (such as SHA-1), so as to obtain the applet signature.
[0090] In this embodiment, by obtaining the request parameters of the applet and generating the signature information of the applet, it can be ensured that the applet is not tampered with during transmission, the applet is prevented from being reverse-engineered or cracked, and the security of user information is improved.
[0091] In a possible implementation, the applet password-free login method provided in this embodiment further includes: detecting a network connection state, the network connection state including a cellular network connection, a wireless network connection, and a dual-network connection; and switching the network connection state to the cellular network connection, before the pre-fetching number request is sent to the operator end.
[0092] It can be understood that, in the process of traditional applet login, the JSSDK relied on runs in a web view container, and the capabilities provided by the SDK are limited to the browser kernel. That is, when the user device is connected to both WIFI and cellular network, the SDK will use the WIFI network by default to initiate a network request depending on the browser kernel, while the password-free login of the mobile phone number relies on the pre-fetching number request initiated by the cellular network, resulting in a failure of the pre-fetching number when dual-network connection.
[0093] In this embodiment, the cellular network is forced to be used to initiate the pre-fetching number request, avoiding the problem of pre-fetching number failure of the traditional JSSDK under the condition of dual-network.
[0094] In a possible implementation, the applet password-free login method provided in this embodiment returns the pre-fetching number result through an API callback function, and decides to call the user authorization page or the user-defined login page according to the pre-fetching number result.
[0095] Specifically, arousing the user authorization page based on the plug-in pre-fetch number API includes: returning a pre-fetch number result through an API callback function; when the pre-fetch number result is successful, arousing a preset user authorization page and filling the mobile phone mask into a target column of the user authorization page.
[0096] Further, when the pre-fetch number result is failed or a user sends an instruction to modify the mobile phone mask, a preset user self-defined login page is aroused, and the user self-defined login page provides a mobile phone number input column or an account number input column.
[0097] It can be understood that a callback function can be defined in advance for processing the pre-fetch number result, and the callback function is called after the pre-fetch number result is returned. The pre-fetch number is returned at the operator end, and the callback function is triggered to arouse the user authorization page. The user authorization page can display the authorization page, the mobile phone mask, and the user agreement to the user.
[0098] It should be noted that only the mobile phone mask is returned without returning the access code in this step, which can further ensure the security of user operation. That is, the mini-program plug-in uses the local data encryption storage provided by the host App container, and the data stored by the mini-program plug-in can only be read and decrypted by the plug-in itself, realizing local encryption storage of the pre-fetch number data, preventing being attacked by attackers, and improving the overall security.
[0099] In this embodiment, the pre-fetch number result is returned through the API callback function, and the user authorization page or the user self-defined login page is aroused according to the pre-fetch number result. On the one hand, the next operation can be determined according to the real-time pre-fetch number result, which can effectively prevent some security vulnerabilities and attacks and improve the security of the system. On the other hand, the user state can be determined in advance, unnecessary server requests and processing are reduced, and the system performance is optimized.
[0100] In a possible implementation, the mini-program password-free login method provided in this embodiment realizes verification of a mini-program signature and verification of a mobile phone number substitution request through an operator end.
[0101] Specifically, the operator end verifies the mini-program signature, generates a security token after verification, associates the security token with the access code at the operator end, and the security token includes a timestamp.
[0102] On the other hand, the operator end verifies the association between the access code and the security token; if the verification is passed, it is judged whether the time interval between sending and feeding back the security token is not more than a first preset value; if yes, it is confirmed that the verification is passed; if no, it is confirmed that the verification is not passed.
[0103] It can be understood that the applet sends the generated signature to the server of the operator. After the operator verifies the validity of the signature, a security token can be generated, which is temporary, time-limited and unique. The operator returns the generated security token to the applet. After the applet receives the security token, it is stored locally or in memory. When the applet needs to obtain the user's mobile phone number, the security token is sent to the server of the operator. After the operator verifies the validity of the security token and confirms the legality of the request, the user's mobile phone number is returned to the applet. Through this means, through the signature and security token mechanism, unauthorized access and data leakage can be effectively prevented. Each operation is recorded and signed, which can be traced and audited to ensure the legality and compliance of the operation. Moreover, the security token is time-limited and unique, preventing the reuse and abuse of the token, improving the overall security and reliability.
[0104] In this embodiment, the verification of the applet signature and the verification of the mobile phone number substitution request are implemented by the operator side. The user's mobile phone number will not be directly exposed to the applet developer, but will be transferred and verified by the operator, protecting the user's privacy and effectively preventing unauthorized access and data leakage.
[0105] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action order described, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0106] It should be further noted that although each step in the flowchart is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless explicitly stated in this document, the execution of these steps has no strict order limitation, and these steps can be executed in other order. Moreover, at least part of the steps in the flowchart can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or other steps, sub-steps or stages.
[0107] Figure 4 A schematic diagram of the applet password-free login device provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the applet password-free login device includes: Figure 4
[0108] The pre-fetching number module 41 is configured to acquire a plug-in pre-fetching number application programming interface (API) and an applet signature, generate a pre-fetching number request based on the plug-in pre-fetching number API and the applet signature, and send the pre-fetching number request to the operator end, where the applet signature is used to verify the source of the plug-in pre-fetching number API.
[0109] The authorization module 42 is configured to acquire an access code and a mobile phone mask code fed back by the operator end, locally encrypt and store the access code, and arouse a user authorization page based on the plug-in pre-fetching number API, where the user authorization page includes the mobile phone mask code, and the mobile phone mask code is used to confirm authorization information of the user.
[0110] The authorization trace module 43 is configured to acquire the access code from the local decryption in response to an instruction of user authorization, generate an authorization trace request based on the access code and the applet signature, send the authorization trace request to the operator end, and acquire a security token.
[0111] The login module 44 is configured to arouse a login page based on the access code and the security token, generate a mobile phone number substitution request based on the access code and the security token in response to a login operation instruction of the user, send the mobile phone number substitution request to the operator end, obtain a user mobile phone number, complete login, and perform number substitution verification by using the access code and the security token, and feed back the user mobile phone number by the operator end after the verification is passed.
[0112] In a possible design, the pre-fetching number module 41 is specifically configured to:
[0113] acquire a request parameter and a host token of the applet, where the request parameter includes a plug-in pre-fetching number API and an AppID of the applet;
[0114] construct a signature string according to the request parameter and the host token according to a preset rule, and encrypt the signature string to obtain an applet signature.
[0115] In a possible design, the pre-fetching number module 41 is specifically configured to:
[0116] detect a network connection state, where the network connection state includes a cellular network connection, a wireless network connection, and a dual network connection;
[0117] switch the network connection state to the cellular network connection.
[0118] In a possible design, the authorization module 42 is specifically configured to:
[0119] return a pre-fetching number result through an API callback function;
[0120] When the pre-fetching result is success, a preset user authorization page is invoked, and the mobile phone mask is filled into a target column of the user authorization page.
[0121] In a possible design, the authorization module 42 is specifically configured to:
[0122] When the pre-fetching result is failure or a user sends an instruction to modify the mobile phone mask, a preset user self-defined login page is invoked, and the user self-defined login page provides a mobile phone number input column or an account number input column.
[0123] It should be understood that the apparatus embodiments described above are merely illustrative, and the apparatus of the present application can also be implemented in other manners. For example, the division of the units / modules in the above-described embodiments is merely a logical function division, and actual implementation can be in another division manner. For example, a plurality of units / modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0124] In addition, unless specifically described, each functional unit / module in each embodiment of the present application can be integrated in one unit / module, or each unit / module can exist physically, or two or more units / modules can be integrated together. The integrated unit / module can be implemented in the form of hardware or in the form of a software program module.
[0125] Figure 5 A structural schematic diagram of an electronic device for the method for password-free login of an applicable applet provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the electronic device of the embodiment includes at least one processor 50 (only one processor is shown in FIG. 1), a memory 51, and a computer program stored in the memory 51 and executable on the at least one processor 50, and the processor 50 implements the steps in any of the method embodiments described above when executing the computer program. Figure 5 Figure 5 The electronic device can include, but is not limited to, the processor 50 and the memory 51. Those skilled in the art can understand that the electronic device is merely an example of the electronic device and does not constitute a limitation on the electronic device, and can include more or fewer components than those shown in the figure, or combine certain components or different components, for example, can also include an input / output device, a network access device, and the like.
[0126] The electronic device can include, but is not limited to, the processor 50 and the memory 51. Those skilled in the art can understand that the electronic device is merely an example of the electronic device and does not constitute a limitation on the electronic device, and can include more or fewer components than those shown in the figure, or combine certain components or different components, for example, can also include an input / output device, a network access device, and the like. Figure 5
[0127] The processor 50 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0128] The specific implementation process of the processor 501 can refer to the method embodiments described above, which have similar implementation principles and technical effects, and details are not described here.
[0129] The storage 51 can be an internal storage unit of the electronic device in some embodiments, for example, a memory of the electronic device. The storage 51 can also be an external storage device of the electronic device in other embodiments, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the storage 51 can include both the internal storage unit and the external storage device of the electronic device. The storage 51 is used to store an operating system, an application program, a boot loader, data and other programs, for example, program codes of a computer program, etc. The storage 51 can also be used to temporarily store data that has been output or will be output.
[0130] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the above-mentioned various method embodiments.
[0131] The above-mentioned computer readable storage medium can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0132] An example readable storage medium is coupled to the processor such that the processor can read information from, and write information to, the readable storage medium. Of course, the storage medium can be a part of the processor. Consistent with the teachings provided herein, the processor can execute instructions embodied by the readable storage medium, and the instructions can cause the processor to perform the steps of the methods described herein. The instructions can be software readable by the processor. For example, the instructions can include code modules executable by the processor, and / or code modules that cause the processor to instantiate other code modules, etc. The software can be stored in a non-transitory computer-readable storage medium, such as the storage device(s) described above. Of course, the storage medium can also be a part of the processor, as well.
[0133] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes: ROM, RAM, magnetic disk or optical disk and various storage medium that can store program codes.
[0134] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the disclosure.
[0135] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The specification and examples given are exemplary only and the true scope and spirit of the application is indicated by the claims which follow. It will be appreciated by persons skilled in the art that numerous variations and / or modifications can be made to the application as described herein. It is to be understood that while the application has been described above in conjunction with specific embodiments, the application is not intended to be limited to such specific embodiments. Rather, it is intended to cover all alternatives, modifications, and equivalents of those specific embodiments in accordance with the scope and spirit of the application as defined by the appended claims.
[0136] It is to be understood that the application is not limited to the precise construction described in the specification and shown in the drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application as set forth in the claims. The scope of the application is limited only by the claims that follow.
Claims
1. A method for password-free login to a mini-program, characterized in that, include: Obtain the plugin pre-fetching application programming interface (API) and the mini-program signature; generate a pre-fetching request based on the plugin pre-fetching API and the mini-program signature; and send the pre-fetching request to the operator. The mini-program signature is used to verify the source of the plugin pre-fetching API. Obtain the access code and mobile phone mask returned by the operator, encrypt and store the access code locally, and invoke the user authorization page based on the plugin pre-fetching API. The user authorization page includes the mobile phone mask, which is used by the user to confirm the authorization information. In response to the user's authorization instruction, the access code is decrypted locally and obtained. An authorization trace request is generated based on the access code and the mini-program signature. The authorization trace request is sent to the operator's end to obtain a security token. The login page is invoked based on the access code and the security token. In response to the user's login operation command, a mobile number replacement request is generated according to the access code and the security token. The mobile number replacement request is sent to the operator to obtain the user's mobile number and complete the login. The access code and the security token are used for number replacement verification. After the verification is successful, the operator returns the user's mobile number.
2. The method according to claim 1, characterized in that, The process of obtaining the plugin pre-fetching application programming interface (API) and the mini-program signature includes: Obtain the request parameters and host token of the mini program. The request parameters include the plugin pre-fetching API and the mini program's AppID. A signature string is constructed based on the request parameters and the host token according to preset rules, and the signature string is encrypted to obtain the mini-program signature.
3. The method according to claim 1 or 2, characterized in that, Before sending the pre-fetch number request to the operator, the method further includes: Detect network connectivity status, including cellular network connection, wireless network connection, and dual network connection; Switch the network connection status to the cellular network connection.
4. The method according to claim 1, characterized in that, The step of invoking the user authorization page based on the plugin pre-fetching API includes: The pre-fetched number result is returned via the API callback function; When the number retrieval result is successful, the preset user authorization page is invoked, and the mobile phone mask is filled into the target field of the user authorization page.
5. The method according to claim 4, characterized in that, After invoking the user authorization page based on the plugin prefetch API, the following is also included: When the number retrieval result fails or an instruction is received from the user to modify the phone number mask, a preset user-defined login page is invoked, which provides a phone number input field or an account input field.
6. The method according to claim 1, characterized in that, In the step of sending the authorization trace request to the operator to obtain a security token, the operator verifies the signature of the mini-program. After the verification is successful, a security token is generated. The security token is associated with the access code on the operator's side, and the security token includes a timestamp.
7. The method according to claim 6, characterized in that, The specific steps for using the access code and the security token to perform number replacement verification are implemented by the operator, including: The association between the access code and the security token is verified; If the verification passes, determine whether the time interval between sending and receiving the security token does not exceed a first preset value; If so, confirm that the verification passed; Lagging behind, verification failed.
8. A password-free login device for a mini-program, characterized in that, include: The number retrieval module is used to obtain the plugin number retrieval application programming interface (API) and the mini-program signature, generate a number retrieval request based on the plugin number retrieval API and the mini-program signature, and send the number retrieval request to the operator. The mini-program signature is used to verify the source of the plugin number retrieval API. The authorization module is used to obtain the access code and mobile phone mask returned by the operator, encrypt and store the access code locally, and invoke the user authorization page based on the plugin pre-fetching API. The user authorization page includes the mobile phone mask, which is used by the user to confirm the authorization information. The authorization retention module is used to respond to the user's authorization instruction, decrypt and obtain the access code from the local machine, generate an authorization retention request based on the access code and the mini-program signature, send the authorization retention request to the operator, and obtain a security token. The login module invokes the login page based on the access code and the security token. In response to the user's login operation command, it generates a mobile number replacement request based on the access code and the security token, sends the mobile number replacement request to the operator, obtains the user's mobile number, and completes the login. The access code and the security token are used for number replacement verification. After the verification is successful, the operator returns the user's mobile number.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Password-free login method, device, equipment and storage medium
CN112039889A
Secret-free login method and device, equipment and storage medium
CN117614722A