Small program password-free login method and device, equipment, storage medium and program product
By obtaining the signature and API of the mini program plug-in, verifying the source of the network request, generating and using access codes and security tokens, the security of the password-free login of the mini program can be improved, preventing illegal interface calls and pages from being hidden, and ensuring the security of user information.
Patent Information
- Application Number
- CN202410822369.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing password-free login solutions for small programs run the risk of illegal API calls, allowing attackers to intercept user information, and the login authorization page is less secure and can easily be hidden or overwritten.
By obtaining the plug-in prefetch number application programming interface API and applet signature, generate a prefetch number request and send it to the operator, obtain the access code and store it locally encrypted, evoke the user authorization page, and generate authorization traces in response to user authorization instructions. Request, obtain a security token, generate a mobile phone number replacement request based on the access code and security token, complete the login, and verify the source of the network request through the mini program signature to prevent illegal calls to the interface.
It effectively prevents the interface from being called illegally, ensures that users can normally view the authorization page and complete one-click login, ensures the security of user information, and prevents the page from being hidden or overwritten.
Smart Images

Figure CN118842618A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, device, equipment, storage medium and program product for password-free login to a mini-program. Background Art
[0002] Mini Program is a lightweight application that can be used without downloading and installing. It is usually embedded in a platform and runs. They are developed through the framework and interface provided by the platform. Users can quickly access and use the mini program by scanning QR codes, searching, sharing, etc. Mini Programs are suitable for various scenarios and needs due to their advantages of lightweight, convenience and efficiency. In the current mini program scenario, the mini program application integrates the operator JavaScript software development tool (JSSDK) package to obtain and verify the mobile phone number, thereby realizing password-free login. After the user enters the login page of the mini program, the mini program application initiates a password-free login pre-retrieval 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 chooses to authorize the login, the mini program application obtains the accesscode from the operator JSSDK and initiates a login request to the application backend service. The mini program application backend service replaces the mobile phone number from the operator backend service through the accesscode. After the replacement is successful, the entire login process is completed.
[0003] However, in this process, JSSDK is easy to be obtained and analyzed. If an attacker analyzes the format and parameters of the JSSDK pre-number request, he can initiate a pre-number request on his own without integrating the SDK. As a result, the existing mini-program password-free login solution has the risk of illegal calls to the Application Programming Interface (API). When the attacker initiates the pre-number request on his own and obtains the return result, he can obtain the device's mobile phone number without the user's knowledge without displaying the user's authorization page. From another perspective, in the existing mini-programs, the login authorization page provided by JSSDK is added to the mini-program page for display by nesting inline frames (iframe nesting). Attackers can also use the characteristics of iframes to induce users to click the confirmation authorization button by hiding the display, covering other pages, and click interception, resulting in the attacker obtaining the user's device mobile phone number without the user's knowledge. Therefore, the security of the existing mini-program password-free login solution needs to be improved. Summary of the invention
[0004] The present application provides a method, device, equipment, storage medium and program product for mini-program password-free login, which are used to solve the problem that the existing mini-program password-free login technology is easy to be intercepted by attackers and has poor security.
[0005] In a first aspect, the present application provides a method for logging into a mini program without a password, including:
[0006] Obtain the plug-in pre-number application programming interface API and the mini-program signature, generate a pre-number request based on the plug-in pre-number API and the mini-program signature, and send the pre-number request to the operator side, where the mini-program signature is used to verify the source of the plug-in pre-number API;
[0007] Obtain the access code and mobile phone mask fed back by the operator, encrypt and store the access code locally, and call up a user authorization page based on the plug-in pre-number API, wherein the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information;
[0008] In response to the user's instruction to agree to the authorization, the access code is obtained from the local decryption, an authorization trace request is generated according to the access code and the signature of the mini program, and the authorization trace request is sent to the operator to obtain a security token;
[0009] Based on the access code and the security token, a login page is invoked, and in response to the user's login operation instruction, a mobile phone number replacement request is generated according to the access code and the security token, and the mobile phone number replacement request is sent to the operator side to obtain the user's mobile phone number and complete the login. The access code and the security token are used for number replacement verification. After the verification is passed, the operator side returns the user's mobile phone number.
[0010] Optionally, in the method described above, the step of obtaining a plug-in pre-number application programming interface API and a mini-program signature includes:
[0011] Obtain the request parameters and host token of the mini program, wherein the request parameters include the plug-in pre-number API and the AppID of the mini program;
[0012] A signature string is constructed according to the request parameters and the host token according to preset rules, and the signature string is encrypted to obtain the mini-program signature.
[0013] Optionally, the method as described above, before sending the pre-number request to the operator side, further includes:
[0014] Detecting a network connection status, where the network connection status includes a cellular network connection, a wireless network connection, and a dual network connection;
[0015] Switch the network connection state to the cellular network connection.
[0016] Optionally, in the method described above, the step of calling up a user authorization page based on the plug-in pre-fetching number API includes:
[0017] Return the pre-fetched number result through the API callback function;
[0018] When the pre-number acquisition result is successful, a preset user authorization page is called up, and the mobile phone mask is filled into the target column of the user authorization page.
[0019] Optionally, the method as described above, after calling the user authorization page based on the plug-in pre-retrieval API, further includes:
[0020] When the pre-number acquisition result is a failure or an instruction to modify the mobile phone mask is received from the user, a preset user-defined login page is called up, and the user-defined login page provides a mobile phone number input field or an account number input field.
[0021] Optionally, in the method described above, in the step of sending the authorization trace request to the operator side and obtaining a security token, the operator side verifies the signature of the mini-program, and generates a security token after the verification is passed. The security token is associated with the access code on the operator side, and the security token includes a timestamp.
[0022] Optionally, in the method described above, the specific step of using the access code and the security token to perform number replacement verification is implemented by the operator side and includes:
[0023] Verifying the association between the access code and the security token;
[0024] If the verification is passed, determining whether the time interval between sending and feedback of the security token does not exceed a first preset value;
[0025] If yes, confirm that the verification has passed;
[0026] Falling behind, confirmation check failed.
[0027] In a second aspect, the present application provides a mini-program password-free login device, comprising:
[0028] A pre-number acquisition module is used to obtain a plug-in pre-number acquisition application programming interface API and a mini-program signature, generate a pre-number acquisition request based on the plug-in pre-number acquisition API and the mini-program signature, and send the pre-number acquisition request to the operator side, wherein the mini-program signature is used to verify the source of the plug-in pre-number acquisition API;
[0029] An authorization module is used to obtain the access code and mobile phone mask fed back by the operator, encrypt and store the access code locally, and call up a user authorization page based on the plug-in pre-number API, wherein the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information;
[0030] An authorization trace module is used to respond to the user's instruction to agree to the authorization, obtain the access code from the local decryption, generate an authorization trace request according to the access code and the mini program signature, send the authorization trace request to the operator side, and obtain a security token;
[0031] The login module invokes the login page based on the access code and the security token, responds to the user's login operation instruction, generates a mobile phone number replacement request according to the access code and the security token, sends the mobile phone number replacement request to the operator side, obtains the user's mobile phone number, completes the login, and the access code and the security token are used for number replacement verification. After the verification is passed, the operator side feedbacks the user's mobile phone number.
[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 when the processor executes the computer-executable instructions, the mini-program password-free login method described in any one of the first aspects above is implemented.
[0033] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the mini-program password-free login method described in any one of the first aspects above.
[0034] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the mini-program password-free login method described in any one of the first aspects above.
[0035] The mini-program password-free login method, apparatus, device, storage medium and program product provided by the present application obtain the plug-in pre-number application programming interface API and the mini-program signature, generate a pre-number request based on the plug-in pre-number API and the mini-program signature, and send the pre-number request to the operator side, where the mini-program signature is used to verify the source of the plug-in pre-number API; obtain the access code and mobile phone mask fed back by the operator side, encrypt and store the access code locally, and call up the user authorization page based on the plug-in pre-number API, where the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information; in response to the user's instruction to agree to the authorization, decrypt and obtain the access code locally, generate an authorization trace request based on the access code and the mini-program signature, and send the authorization trace request to the operator side to obtain a security token; based on the access code and The security token calls up the login page, responds to the user's login operation instruction, generates a mobile phone number replacement request according to the access code and the security token, sends the mobile phone number replacement request to the operator side, obtains the user's mobile phone number, and completes the login. The access code and the security token are used to perform number replacement verification. After the verification, the operator side returns the user's mobile phone number, and the mini-program signature is used to implement the operator's verification that the network request comes from the mini-program plug-in, ensuring that the pre-number acquisition and authorization trace interface can only be accessed by the mini-program plug-in to prevent the interface from being illegally called. In addition, the user authorization login page provided by the mini-program plug-in completes the authorization trace, ensuring that the authorization trace API call can only be completed by this page, and the mini-program application cannot hide, cover, or click-block the page displayed by the plug-in, ensuring that the user can normally view the authorization page to complete one-click login, thereby ensuring the security of user information. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] Figure 1 The interactive diagram of the method for password-free login to a mini program in the prior art.
[0038] Figure 2 An interactive diagram of the mini-program password-free login method provided in an embodiment of the present application.
[0039] Figure 3 A flowchart of the mini-program password-free login method provided in an embodiment of the present application.
[0040] Figure 4 A schematic diagram of a mini-program password-free login device provided in an embodiment of the present application.
[0041] Figure 5A schematic diagram of the structure of an electronic device that enables the mini-program password-free login method to be applicable to an embodiment of the present application.
[0042] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit 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] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[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 used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0045] In related technologies, such as Figure 1 As shown, Figure 1 The interactive diagram of the method of password-free login for mini-programs in the prior art is that the mini-program application obtains and verifies the mobile phone number by integrating the operator's JavaScript software development tool (JSSDK) package, thereby realizing password-free login. After the user enters the login page of the mini-program, the mini-program application initiates a password-free login pre-number acquisition request through the operator's JSSDK, receives the access code (accesscode) and mobile phone mask information returned by the operator service, and then the operator's JSSDK is responsible for pulling up the login authorization page and displaying the mobile phone mask information. After the user chooses to authorize the login, the mini-program application obtains the accesscode from the operator's JSSDK and initiates a login request to the application backend service. The mini-program application backend service replaces the mobile phone number from the operator's backend service through the accesscode, and the entire login process is completed after the replacement is successful.
[0046] In response to the above technical problems, the embodiments of the present application aim to propose a method, device, equipment, storage medium and program product for password-free login of mini-programs. The main concept of the method is as follows: the mini-program plug-in uses the signature information carried by the network request of the host App container to realize the server-side verification that the network request comes from the mini-program plug-in, ensuring that the pre-number acquisition and authorization trace interface can only be accessed by the mini-program plug-in to prevent the interface from being illegally called. In addition, the user authorization login page provided by the mini-program plug-in completes the authorization trace. The plug-in uses the page permission management mechanism and request signature information provided by the host App container to ensure that the authorization trace API call can only be completed by this page, and the mini-program application cannot hide, cover, or click-intercept the page displayed by the plug-in, ensuring that the user can normally view the authorization page and complete one-click login. Furthermore, the mini-program plug-in also uses the host App container to realize the dual-network forced switching of cellular networks, avoiding the problem of the failure of the traditional JSSDK to pre-acquire numbers under dual-network conditions, and realizes local data encryption storage through the host App container, further improving the overall security.
[0047] In order to better understand the solution of the embodiment of the present application, an application scenario involved in the embodiment of the present application is first introduced below.
[0048] See also Figure 2 , Figure 2 A schematic diagram of an interactive diagram of a method for logging into a mini-program without a password provided in an embodiment of the present application, such as Figure 2 As shown, it includes a mini program application 100 and an operator end 200, wherein 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 plug-in, and a mini program back end. The mini program application 100 receives the user's trigger login operation and sends a related request to the operator end 200 with signature information. Specifically, it may include three stages: pre-acquisition of number, authorization trace, and number replacement:
[0049] (1) Pre-numbering stage:
[0050] The user triggers the login operation;
[0051] The mini program front end calls the mini program plug-in pre-fetch number API;
[0052] The mini-program plug-in initiates a network request for pre-fetching a number. The mini-program plug-in uses the request API provided by the host (such as wx.request API) to implement the mandatory use of the cellular network to initiate the pre-fetching number request under dual network conditions. In addition, when the mini-program plug-in uses the request API provided by the host to initiate the pre-fetching number network request, the host App will carry an additional signature information to verify that the request comes from the mini-program plug-in. The server interface will verify the signature and limit the mini-program plug-in to initiate the call of this interface.
[0053] The server interface service first verifies the request signature information, and after verification, performs a pre-number operation through the cellular network information to generate a verification code;
[0054] The server interface returns the pre-retrieval result, verification code and mobile phone mask information;
[0055] After receiving the response, the mini program plug-in uses the request API provided by the host to encrypt and store the pre-fetched number verification code locally. The host App ensures that only the plug-in itself can read the data;
[0056] The mini program plug-in returns the pre-acquisition number result and mobile phone mask information through the API callback method. To ensure security, the verification code information will not be returned in the callback.
[0057] (2) Authorization and traceability stage:
[0058] After the Mini Program front-end receives the pre-number retrieval result, it can jump to the page according to the result. If the pre-number retrieval is successful, it will call up the user authorization login page provided by the Mini Program plug-in. If it fails, it will open the login page of the application itself (mobile phone verification code login or account password login page, etc.);
[0059] The mini program plug-in displays the user authorization login page, showing the phone mask, user agreement, one-click login button, etc.
[0060] The user checks the box to agree to the authorization and clicks the one-click login button;
[0061] The mini program plug-in uses the request API provided by the host to read data from local storage and decrypt it to obtain the verification code. The host App ensures that only the plug-in itself can read the data;
[0062] The mini-program plug-in initiates an authorized trace network request and carries the verification code information. When the mini-program plug-in uses the request API provided by the host to initiate an authorized trace network request, the host App will carry an additional signature information to verify that the request comes from the mini-program plug-in. The server interface will verify the signature and limit the mini-program plug-in to initiate the call of this interface;
[0063] The server-side interface service first verifies the request signature information, records the authorization trace information after verification, 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 server interface returns a security token;
[0065] After receiving the response, the mini program plug-in will jump to the specified page of the mini program front end and pass the verification code and security token as page parameters.
[0066] (3) Number replacement phase:
[0067] The mini program frontend initiates a login request to the application server, carrying the verification code and security token information;
[0068] After receiving the request, the application server sends a number replacement request to the operator server with the verification code and security token information;
[0069] After receiving the request, the server will verify whether the verification code and security token are associated, whether they have expired, etc. After the verification is passed, the mobile phone number will be replaced;
[0070] The server interface returns the mobile phone number information;
[0071] The application server receives the response, obtains the mobile phone number, completes the subsequent login operation, and returns the login result.
[0072] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0073] Figure 3 This is a flowchart of the mini-program password-free login method provided in the embodiment of the present application. Figure 3 As shown, the method of this embodiment includes:
[0074] S301: Obtain the plug-in pre-number application programming interface API and the mini-program signature, generate a pre-number request based on the plug-in pre-number API and the mini-program signature, and send the pre-number request to the operator side. The mini-program signature is used to verify the source of the plug-in pre-number API.
[0075] The execution subject of the embodiment of the present application may be a mini-program application, wherein the mini-program application is embedded in a host App.
[0076] It is understandable that API is a set of definitions and protocols for building and integrating software applications. API allows communication and data exchange between different software systems. Mini-program applications can use the network request interface provided by the host App to initiate HTTP requests to the server. For example, wx.request is a network request interface in the host mini-program, which is used to initiate HTTP requests to the server in the mini-program. Through wx.request, developers can implement data interaction with the back-end server in the mini-program, such as obtaining data, submitting forms, uploading files, and other operations.
[0077] In this embodiment, when the mini-program plug-in initiates a pre-number request, it will also carry a signature information, that is, the mini-program signature, which can be used to verify that the request comes from the mini-program plug-in. The pre-number request is sent to the operator's server, and the server interface will verify the signature, limiting that only the mini-program plug-in can initiate the call of the interface.
[0078] S302: Obtain the access code and mobile phone mask fed back by the operator, encrypt and store the access code locally, and invoke the user authorization page based on the plug-in pre-retrieval API. The user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information.
[0079] In this step, the access code is a code used for identity authentication, authorization or access to specific resources. After receiving the response, the mini program application can use the API provided by the host App to encrypt and store the pre-fetched access code locally, thereby using the host App to ensure that only the plug-in itself can read the data.
[0080] S303: In response to the user's instruction to agree to authorization, the access code is obtained from local decryption, an authorization trace request is generated according to the access code and the mini-program signature, and the authorization trace request is sent to the operator to obtain a security token.
[0081] It is understandable that the security token sent by the operator refers to a security token used for identity authentication and authorization, which can ensure the identity of the user and allow the user to access specific services or resources. Exemplarily, a security token can be an authentication token used to verify the identity of the user and ensure that the user is legitimate. That is, when a user logs in to a 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. Security tokens are usually generated by operators or service providers and sent to users in a secure manner (such as encryption) to ensure their security and uniqueness. The use of security tokens can significantly improve the security of the system and prevent unauthorized access and operation.
[0082] S304: Invoke the login page based on the access code and the security token, respond to the user's login operation instruction, generate a mobile phone number replacement request according to the access code and the security token, send the mobile phone number replacement request to the operator side, obtain the user's mobile phone number, complete the login, the access code and the security token are used for number replacement verification, and the operator side returns the user's mobile phone number after the verification is passed.
[0083] In this step, after receiving the login instruction, the mini program application carries the access code and security token to initiate a number replacement request to the operator. The operator verifies the access code and security token, and replaces the mobile phone number after the verification. The mini program application can then obtain the mobile phone number, complete subsequent login operations, and return the login result.
[0084] The mini-program password-free login method provided in this embodiment obtains the plug-in pre-number application programming interface API and the mini-program signature, generates a pre-number request based on the plug-in pre-number API and the mini-program signature, and sends the pre-number request to the operator side, where the mini-program signature is used to verify the source of the plug-in pre-number API; obtains the access code and mobile phone mask fed back by the operator side, encrypts and stores the access code locally, and calls up the user authorization page based on the plug-in pre-number API, where the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information; in response to the user's instruction to agree to the authorization, obtains the access code from the local decryption, generates an authorization trace request based on the access code and the mini-program signature, sends the authorization trace request to the operator side, and obtains a security token; calls up the operator side based on the access code and the security token The system starts a login page, responds to the user's login operation instruction, generates a mobile phone number replacement request according to the access code and the security token, sends the mobile phone number replacement request to the operator, obtains the user's mobile phone number, completes the login, and the access code and the security token are used to perform number replacement verification. After the verification, the operator returns the user's mobile number, and uses the mini-program signature to implement the operator's verification that the network request comes from the mini-program plug-in, ensuring that the pre-number acquisition and authorization trace interface can only be accessed by the mini-program plug-in to prevent the interface from being illegally called. In addition, the user authorization login page provided by the mini-program plug-in completes the authorization trace, ensuring that the authorization trace API call can only be completed by this page, and the mini-program application cannot hide, cover, or click-block the page displayed by the plug-in, ensuring that the user can normally view the authorization page to complete one-click login, thereby ensuring the security of user information.
[0085] The following is a detailed introduction to the technical solution of the above-mentioned mini-program password-free login method.
[0086] In a possible implementation, the mini-program password-free login method provided in this embodiment obtains the request parameters of the mini-program and generates the signature information of the mini-program.
[0087] Specifically, obtaining the plug-in pre-number application programming interface API and the mini-program signature includes: obtaining the request parameters and host token of the mini-program, the request parameters including the plug-in pre-number API and the AppID of the mini-program; constructing a signature string according to the request parameters and the host token according to preset rules, and encrypting the signature string to obtain the mini-program signature.
[0088] It is understandable that the request parameters of the mini program may include the mini program's unique identifier AppID, the current time timestamp TIMESTAMP, and a random string NONCESTR, etc. The host token, that is, the host App's token, can be found in the basic settings of the mini program plug-in. This token is only known to the mini program plug-in developer and the plug-in server developer, and is used to ensure the security of the signature calculation.
[0089] Exemplarily, the preset calculation rule may be SIGNATURE=sha1([APPID,NONCESTR,TIMESTAMP,TOKEN].sort().join(”)), that is, the above four parameters are put into this array, and after sorting the array, the elements of these arrays are connected into a signature string, and the signature string can be hashed (for example, SHA-1) to obtain the mini program signature.
[0090] In this embodiment, by obtaining the request parameters of the mini-program and generating the signature information of the mini-program, it can be ensured that the mini-program is not tampered with during the transmission process, prevent the mini-program from being reverse engineered or cracked, and improve the security of user information.
[0091] In a possible implementation, the mini-program password-free login method provided in this embodiment further includes, before sending the pre-number request to the operator side: detecting the network connection status, the network connection status including cellular network connection, wireless network connection and dual network connection; switching the network connection status to the cellular network connection.
[0092] It is understandable that, because the JSSDK that the traditional mini-program login relies on runs in a web view container (webview container), the capabilities provided by the SDK are limited by the browser kernel. In other words, when the user's device is connected to both WIFI and cellular networks, the SDK relies on the browser kernel to initiate network requests and will use the WIFI network by default, while the mobile phone number password-free login relies on the pre-number request initiated by the cellular network, resulting in the failure of pre-number acquisition when both networks are connected.
[0093] In this embodiment, the cellular network is forced to initiate a pre-number acquisition request to avoid the problem of failure of the traditional JSSDK to pre-acquire numbers under dual network conditions.
[0094] In a possible implementation, the mini-program password-free login method provided in this embodiment returns the pre-retrieval result through an API callback function, and decides to call up the user authorization page or the user-defined login page based on the pre-retrieval result.
[0095] Specifically, calling up the user authorization page based on the plug-in pre-number API includes: returning the pre-number result through the API callback function; when the pre-number result is successful, calling up the preset user authorization page, and filling the mobile phone mask into the target column of the user authorization page.
[0096] Furthermore, when the pre-retrieval result is a failure or an instruction to modify the mobile phone mask is received from the user, a preset user-defined login page is called up, and the user-defined login page provides a mobile phone number input field or an account number input field.
[0097] It is understandable that a callback function can be pre-defined to process the pre-number result. This callback function will be called after the pre-number result is returned. When the operator returns the pre-number, the callback function is triggered to call up the user authorization page. The user authorization page can show the user the authorization page, the phone mask, and the user agreement.
[0098] It should be noted that in this step, only the mobile phone mask is returned without the access code, which can further ensure the security of user operations. In other words, the mini program plug-in uses the local data encryption storage provided by the host App container, and the data stored in the mini program plug-in can only be read and decrypted by the plug-in itself, realizing the local encrypted storage of pre-fetched number data, preventing it from being exploited by attackers and improving overall security.
[0099] In this embodiment, the pre-number acquisition result is returned through the API callback function, and the user authorization page or the user-defined login page is decided to be called up based on the pre-number acquisition result. On the one hand, the next operation can be determined based on the real-time pre-number acquisition result, which can effectively prevent some security vulnerabilities and attacks and improve the security of the system. On the other hand, the user status can be determined in advance, unnecessary server requests and processing can be reduced, and system performance can be optimized.
[0100] In a possible implementation, the mini-program password-free login method provided in this embodiment implements verification of the mini-program signature and verification of the mobile phone number replacement request through the operator side.
[0101] Specifically, the operator side verifies the signature of the mini program, and generates a security token after the verification is passed. The security token is associated with the access code on the operator side, and the security token includes a timestamp.
[0102] On the other hand, the operator side verifies the association between the access code and the security token; if the verification passes, it determines whether the time interval between the sending and feedback of the security token does not exceed a first preset value; if so, it confirms that the verification passes; if not, it confirms that the verification fails.
[0103] It is understandable that the mini program sends the generated signature to the operator's server. After the operator verifies the validity of the signature, it can generate a security token (Token). This security token is temporary, time-sensitive and unique. The operator returns the generated security token to the mini program. After receiving the security token, the mini program stores it locally or in memory. When the mini program needs to obtain the user's mobile phone number, it sends the security token to the operator's server. The operator verifies the validity of the security token and confirms the legitimacy of the request before returning the user's mobile phone number to the mini program. In this way, through the signature and security token mechanism, unauthorized access and data leakage can be effectively prevented. Each step of the operation is recorded and signed, which can be traced and audited to ensure the legality and compliance of the operation. In addition, the security token is time-sensitive and unique, which prevents the reuse and abuse of the token and improves the overall security and reliability.
[0104] In this embodiment, the operator side verifies the signature of the mini program and verifies the mobile phone number replacement request. The user's mobile phone number will not be directly exposed to the mini program developer. Instead, it will be transferred and verified by the operator, which protects the user's privacy and effectively prevents unauthorized access and data leakage.
[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware 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 the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0107] Figure 4 This is a schematic diagram of a mini-program password-free login device provided in an embodiment of the present application. Figure 4 As shown, the mini-program password-free login device includes:
[0108] The pre-number acquisition module 41 is used to obtain the plug-in pre-number acquisition application programming interface API and the mini-program signature, generate a pre-number acquisition request based on the plug-in pre-number acquisition API and the mini-program signature, and send the pre-number acquisition request to the operator side, wherein the mini-program signature is used to verify the source of the plug-in pre-number acquisition API;
[0109] The authorization module 42 is used to obtain the access code and mobile phone mask fed back by the operator, encrypt and store the access code locally, and call up the user authorization page based on the plug-in pre-number API, the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information;
[0110] The authorization trace module 43 is used to respond to the user's instruction to agree to the authorization, obtain the access code from the local decryption, generate an authorization trace request according to the access code and the mini program signature, and send the authorization trace request to the operator side to obtain a security token;
[0111] The login module 44 invokes the login page based on the access code and the security token, responds to the user's login operation instruction, generates a mobile phone number replacement request according to the access code and the security token, sends the mobile phone number replacement request to the operator side, obtains the user's mobile phone number, completes the login, and the access code and the security token are used for number replacement verification. After the verification is passed, the operator side feedbacks the user's mobile phone number.
[0112] In a possible design, the pre-numbering module 41 is specifically used for:
[0113] Obtain the request parameters and host token of the mini program, wherein the request parameters include the plug-in pre-number API and the AppID of the mini program;
[0114] A signature string is constructed according to the request parameters and the host token according to preset rules, and the signature string is encrypted to obtain the mini-program signature.
[0115] In a possible design, the pre-numbering module 41 is further specifically used for:
[0116] Detecting a network connection status, where the network connection status 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 used for:
[0119] Return the pre-fetched number result through the API callback function;
[0120] When the pre-number acquisition result is successful, a preset user authorization page is called up, and the mobile phone mask is filled into the target column of the user authorization page.
[0121] In a possible design, the authorization module 42 is specifically used for:
[0122] When the pre-number acquisition result is a failure or an instruction to modify the mobile phone mask is received from the user, a preset user-defined login page is called up, and the user-defined login page provides a mobile phone number input field or an account number input field.
[0123] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple 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 otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0125] Figure 5 This is a schematic diagram of the structure of an electronic device that is applicable to the mini-program password-free login method provided in an embodiment of the present application. Figure 5 As shown, the electronic device of this embodiment includes: at least one processor 50 ( Figure 5 Only one is shown in the figure) a processor, a memory 51, and a computer program stored in the memory 51 and executable on at least one processor 50, and when the processor 50 executes the computer program, the steps in any of the above-mentioned method embodiments are implemented.
[0126] The electronic device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will appreciate that Figure 5 These are merely examples of electronic devices and do not constitute a limitation on the electronic devices. The electronic devices may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, the electronic devices may also include input and output devices, network access devices, etc.
[0127] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0128] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0129] In some embodiments, the memory 51 may be an internal storage unit of the electronic device, such as the memory of the electronic device. In other embodiments, the memory 51 may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 51 may also include both an internal storage unit of the electronic device and an external storage device. The memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0130] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0131] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device 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 memory, 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 exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the above-mentioned electronic device.
[0133] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0134] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0136] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for logging into a mini program without a password, characterized in that: include: Obtain the plug-in pre-number application programming interface API and the mini-program signature, generate a pre-number request based on the plug-in pre-number API and the mini-program signature, and send the pre-number request to the operator side, where the mini-program signature is used to verify the source of the plug-in pre-number API; Obtain the access code and mobile phone mask fed back by the operator, encrypt and store the access code locally, and call up a user authorization page based on the plug-in pre-number API, wherein the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information; In response to the user's instruction to agree to the authorization, the access code is obtained from the local decryption, an authorization trace request is generated according to the access code and the signature of the mini program, and the authorization trace request is sent to the operator to obtain a security token; Based on the access code and the security token, a login page is invoked, and in response to the user's login operation instruction, a mobile phone number replacement request is generated according to the access code and the security token, and the mobile phone number replacement request is sent to the operator side to obtain the user's mobile phone number and complete the login. The access code and the security token are used for number replacement verification. After the verification is passed, the operator side returns the user's mobile phone number.
2. The method according to claim 1, characterized in that The method of obtaining the plug-in pre-acquisition number application programming interface API and the applet signature includes: Obtain the request parameters and host token of the mini program, wherein the request parameters include the plug-in pre-number API and the AppID of the mini program; A signature string is constructed according to 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-number request to the operator side, the method further includes: Detecting a network connection status, where the network connection status includes a cellular network connection, a wireless network connection, and a dual network connection; Switch the network connection state to the cellular network connection.
4. The method according to claim 1, characterized in that: The calling of the user authorization page based on the plug-in pre-fetching number API includes: Return the pre-fetched number result through the API callback function; When the pre-number acquisition result is successful, a preset user authorization page is called up, and the mobile phone mask is filled into the target column of the user authorization page.
5. The method according to claim 4, characterized in that After calling the user authorization page based on the plug-in pre-fetching API, the method further includes: When the pre-number acquisition result is a failure or an instruction to modify the mobile phone mask is received from the user, a preset user-defined login page is called up, and the user-defined login page provides a mobile phone number input field or an account number input field.
6. The method according to claim 1, characterized in that In the step of sending the authorization trace request to the operator side and obtaining a security token, the operator side verifies the signature of the mini-program, and generates a security token after the verification. The security token is associated with the access code on the operator side, and the security token includes a timestamp.
7. The method according to claim 6, characterized in that The specific steps of using the access code and the security token to perform number replacement verification are implemented by the operator side and include: Verifying the association between the access code and the security token; If the verification is passed, determining whether the time interval between sending and feedback of the security token does not exceed a first preset value; If yes, confirm that the verification has passed; Falling behind, confirmation check failed.
8. A mini-program password-free login device, characterized in that: include: A pre-number acquisition module is used to obtain a plug-in pre-number acquisition application programming interface API and a mini-program signature, generate a pre-number acquisition request based on the plug-in pre-number acquisition API and the mini-program signature, and send the pre-number acquisition request to the operator side, wherein the mini-program signature is used to verify the source of the plug-in pre-number acquisition API; An authorization module is used to obtain the access code and mobile phone mask fed back by the operator, encrypt and store the access code locally, and call up a user authorization page based on the plug-in pre-retrieval API, wherein the user authorization page includes the mobile phone mask, and the mobile phone mask is used for the user to confirm the authorization information; An authorization trace module is used to, in response to a user's instruction to agree to authorization, obtain the access code from local decryption, generate an authorization trace request according to the access code and the mini-program signature, send the authorization trace request to the operator side, and obtain a security token; The login module invokes the login page based on the access code and the security token, responds to the user's login operation instruction, generates a mobile phone number replacement request according to the access code and the security token, sends the mobile phone number replacement request to the operator side, obtains the user's mobile phone number, completes the login, and the access code and the security token are used for number replacement verification. After the verification is passed, the operator side feedbacks the user's mobile phone number.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to 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 are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
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
Small program login method and device, electronic equipment and storage medium
CN118075022A
Method for determining account information when user is in non-login state, and system
WO2023029476A1
Cited By
Mobile phone number one-key login method and device, electronic equipment and storage medium
CN119136199A
Mobile phone number one-key login method, device, electronic device and storage medium
CN119136199B
Data operation trace processing method, electronic equipment and computer program product
CN119226119A
Secret-free login method and device, electronic equipment and storage medium
CN121367617A
