CN111835677A - User information acquisition method and device and computer storage medium - Google Patents

User information acquisition method and device and computer storage medium Download PDF

Info

Publication number
CN111835677A
CN111835677A CN201910307117.7A CN201910307117A CN111835677A CN 111835677 A CN111835677 A CN 111835677A CN 201910307117 A CN201910307117 A CN 201910307117A CN 111835677 A CN111835677 A CN 111835677A
Authority
CN
China
Prior art keywords
local service
port
server
website
party platform
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910307117.7A
Other languages
Chinese (zh)
Other versions
CN111835677B (en
Inventor
王靖然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Century TAL Education Technology Co Ltd
Original Assignee
Beijing Century TAL Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Century TAL Education Technology Co Ltd filed Critical Beijing Century TAL Education Technology Co Ltd
Priority to CN201910307117.7A priority Critical patent/CN111835677B/en
Publication of CN111835677A publication Critical patent/CN111835677A/en
Application granted granted Critical
Publication of CN111835677B publication Critical patent/CN111835677B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/53Network services using third party service providers

Abstract

The embodiment of the invention provides a method and a device for acquiring user information and a computer storage medium, which comprises the steps of firstly receiving a third-party login instruction which is triggered by a user in a browser and used for logging in a website, and acquiring an address identifier of the website; then judging whether the address identifier of the website is mapped to a first port of the local service according to a set address mapping rule; if so, sending the third-party login instruction to a first port of the local service so that the local service sends a verification request comprising the address identifier of the website to a server of the third-party platform; receiving authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompting whether the user triggers an authorization instruction or not according to the authorization confirmation information; and if the authorization instruction is received, sending the authorization instruction to a server of the third-party platform, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.

Description

User information acquisition method and device and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for acquiring user information and a computer storage medium.
Background
At present, more and more websites support the operation of login and authorization by using the registered account of the third-party platform. For example, when a user accesses a certain website supporting the QQ account login, the user can log in on the login page of the website by inputting the user's QQ account and password, and after the login is successful, the user information such as the user's QQ avatar, nickname, and gender acquired from the server of the QQ can be seen on the page of the website.
In order to support login and authorization by using a registered account of a third-party platform, an operator of a website needs to complete related applications and audit on the third-party platform by using a domain name after the website is online. However, in the joint debugging test stage when the website is not on line, the website server may be deployed on the local service, and if the local service sends a request to request the server of the third-party platform to acquire the user information, the request usually includes a domain name or an IP address of the local service, such as localhost or 127.0.0.1, instead of the domain name after the website is formally on line, and therefore the domain name cannot pass the verification of the server of the third-party platform, and the local service cannot acquire the user information from the server of the third-party platform.
Disclosure of Invention
In view of the above, an embodiment of the present invention provides a method, an apparatus, and a computer storage medium for obtaining user information, so as to overcome a problem that a local service cannot obtain user information from a server of a third-party platform in a test phase in the prior art.
The embodiment of the invention provides a method for acquiring user information, which comprises the following steps:
receiving a third-party login instruction for logging in a website triggered by a user in a browser, and acquiring an address identifier of the website;
judging whether the address identifier of the website is mapped to a first port of a local service according to a set address mapping rule, wherein the website built on the local service can be accessed through the first port of the local service;
if so, sending the third party login instruction to a first port of the local service so that the local service sends a verification request comprising the address identifier of the website to a server of the third party platform;
receiving authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to log in the website by using a selected account of the third-party platform;
and if the authorization instruction is received, sending the authorization instruction to a server of the third-party platform, so that the server of the third-party platform sends user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
Optionally, in a specific embodiment of the present invention, the method further includes: setting the address of the proxy server of the browser as the address identifier of the local service, setting the port of the proxy server of the browser as the second port of the local service, and monitoring the second port of the local service;
correspondingly, the sending the third party login instruction to the first port of the local service includes:
forwarding the third party login instruction from the second port of the local service to the first port of the local service.
Optionally, in an embodiment of the present invention, the method further includes performing port scanning on the local service to determine at least one unoccupied port of the local service, and configuring an unoccupied port of the local service as a first port of the local service.
Optionally, in an embodiment of the present invention, the causing the local service to send the verification request including the address identifier of the website to the server of the third party platform includes:
receiving verification information returned by the local service from the first port according to the third party login request, wherein the verification information comprises an address identifier of a server of a third party platform and an address identifier of the website;
and sending a verification request comprising the address identifier of the website to the server of the third-party platform according to the address identifier of the server of the third-party platform.
Optionally, in a specific embodiment of the present invention, the sending the authorization instruction to the server of the third party platform, so that the sending, by the server of the third party platform, the user information corresponding to the selected account to the first port of the local service according to the authorization instruction includes:
sending the authorization instruction to a server of the third-party platform, and receiving an authorization code returned by the server of the third-party platform according to the authorization instruction;
sending the authorization code to a first port of the local service, so that the local service sends a token acquisition request including the authorization code to a server of the third-party platform through the first port, and receives an authorization token distributed by the server of the third-party platform according to the token acquisition request, wherein the authorization token is used for the local service to request the server of the third-party platform to acquire user information corresponding to the selected account through the first port.
According to another aspect of the embodiments of the present invention, there is also provided a device for locating a code of a test case, including:
the instruction receiving module is used for receiving a third-party login instruction which is triggered by a user in a browser and used for logging in a website and acquiring an address identifier of the website;
the mapping module is used for judging whether the address identifier of the website is mapped to a first port of a local service according to a set address mapping rule, wherein the website built on the local service can be accessed through the first port of the local service;
a first sending module, configured to send the third-party login instruction to a first port of the local service if the third-party login instruction is received, so that the local service sends a verification request including an address identifier of the website to a server of the third-party platform;
a receiving module, configured to receive authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompt the user whether to trigger an authorization instruction according to the authorization confirmation information, where the authorization instruction is used to indicate that the user is authorized to log in the website using a selected account of the third-party platform;
and the second sending module is used for sending the authorization instruction to the server of the third-party platform if the authorization instruction is received, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
According to another aspect of the embodiments of the present invention, there is also provided a computer storage medium having stored therein: the instruction is used for receiving a third-party login instruction which is triggered by a user in a browser and used for logging in a website and acquiring an address identifier of the website;
instructions for determining whether the address identifier of the website is mapped to a first port of a local service according to a set address mapping rule, wherein the website built on the local service can be accessed through the first port of the local service;
if so, sending the third party login instruction to a first port of the local service to enable the local service to send a verification request comprising the address identification of the website to a server of the third party platform;
the server used for receiving the authorization confirmation information returned by the server of the third-party platform according to the verification request and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to use a selected account of the third-party platform to log in the website;
and sending the authorization instruction to the server of the third-party platform if the authorization instruction is received, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
According to the technical scheme, the user information acquisition scheme of the embodiment of the invention firstly receives a third party login instruction which is triggered by a user in a browser and used for logging in a website, and acquires the address identifier of the website; then judging whether the address identifier of the website is mapped to a first port of the local service according to a set address mapping rule; if so, sending the third-party login instruction to a first port of the local service so that the local service sends a verification request comprising the address identifier of the website to a server of the third-party platform; receiving authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompting whether the user triggers an authorization instruction or not according to the authorization confirmation information; and if the authorization instruction is received, sending the authorization instruction to a server of the third-party platform, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction. Therefore, in the development joint debugging stage that the website is not formally on-line, the method can use the address identifier after the website is on-line to access the website built in the local service in the browser according to the set address mapping rule; the third party login instruction can be received through the first port of the local service, and the verification request including the address identifier after the website is on line is sent to the server of the third party platform instead of the address identifier of the local service, so that the third party platform server can perform related verification before user information is sent according to the address identifier after the website is on line.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and for those skilled in the art, other drawings may be obtained according to these drawings.
Fig. 1 shows a flowchart of a method for acquiring user information according to a first embodiment of the present invention.
Fig. 2 shows a flowchart of a user information acquisition method according to a second embodiment of the present invention.
Fig. 3 is a block diagram showing a configuration of a user information acquisition apparatus according to a third embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention should fall within the scope of the protection of the embodiments of the present invention.
Example one
Fig. 1 shows a flowchart of a method for acquiring user information according to a first embodiment of the present invention. As shown in fig. 1, the method for acquiring user information according to the embodiment of the present invention includes the following steps:
step S101, receiving a third party login instruction for logging in a website triggered by a user in a browser, and acquiring an address identifier of the website.
In this embodiment, the user may use a browser installed on a terminal such as a mobile phone or a computer to access the website through an address identifier of the website, where the address identifier of the website may include a domain name or an IP address of the website.
In order to support a website to log in by using a registered account of a third-party platform and acquire corresponding user information in the account, an operator of the website needs to use an address identifier after the website is online to perform related applications on the third-party platform and pass the verification of the third-party platform. Therefore, a user can trigger a third-party login instruction by clicking a third-party login control arranged at any position of a website page, and the third-party login instruction is sent to a server of the website according to the address identifier of the website.
For example, when a user accesses the domain name www.sohu.com of the fox search website, the user can click a third-party login control with a form of a QQ icon in a page through a mouse or a finger to trigger a third-party login instruction for logging in the fox search website by using a QQ account, and the third-party login instruction is sent to the fox search server according to the domain name of the fox search website.
Step S102, judging whether the address identifier of the website is mapped to the first port of the local service according to the set address mapping rule, wherein the website constructed on the local service can be accessed through the first port of the local service.
In this embodiment, at the development joint debugging stage of the website, the server of the website may be temporarily deployed on the local service, and designate the first port for the WWW service, and the user may access the website built on the local service through the domain name or the IP address of the local service and the port number corresponding to the first port. For example, when the first port is selected to be an 8080 port, a website built on the local service may be accessed by entering http:// localhost:8080 or http://127.0.0.1:8080 in the browser.
However, since the website constructed on the local service is visited and not formally online, the user cannot directly visit the website through the address identifier after the website is online, and therefore when the user visits the website constructed on the local service in the browser by using the address identifier after the website is online, the address identifier after the website is online needs to be mapped to the first port of the local service according to the set address mapping rule. Therefore, when the address mapping rule is set, at least the mapping relation between the online address identifier of the website built on the local service and the first port of the local service needs to be set, so that after the address identifier of the website is obtained, whether the website is the website built on the local service can be judged according to the set address mapping rule, and whether a third-party login instruction needs to be sent to the first port of the local service is determined.
Step S103, if yes, sending a third party login instruction to a first port of the local service, so that the local service sends a verification request including the address identifier of the website to a server of the third party platform.
In this embodiment, the verification request is used to request the server of the third party platform to verify whether the website has the authority to log in using the registered account of the third party platform, and the server of the third party platform at least needs to determine whether the website has been checked by the third party platform according to the address identifier of the website in the verification request, that is, whether the website has the authority to log in using the registered account of the third party platform, so that the verification request needs to include the address identifier of the website.
In this embodiment, if it is determined that the address identifier of the website needs to be mapped to the first port of the local service according to the set address mapping rule, that is, when the website is built on the local service, the third party login instruction may be sent to the first port of the local service according to the address of the local service and the port number of the first port, so that the local service may send the verification request including the address identifier of the website to the server of the third party platform through the first port.
Optionally, if it is determined that the address identifier of the website is not required to be mapped to the first port of the local service according to the set address mapping rule, that is, the website is not built on the local service, the third-party login instruction may be sent to the server of the website according to the address identifier of the website.
And step S104, receiving authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to use a selected account number of the third-party platform to log in the website.
In this embodiment, when the address identifier of the website is an address identifier that the third party platform has passed the audit, the server of the third party platform returns authorization confirmation information, where the authorization confirmation information is used to prompt the user to select and authorize the selected account of the third party platform to log in the website, that is, to trigger the authorization instruction.
In this embodiment, the manner of prompting the user whether to trigger the authorization instruction according to the authorization confirmation information is not limited. For example, the authorization confirmation information may include a two-dimensional code for logging in using the QQ platform, and after the user scans the two-dimensional code using the mobile phone, the user may trigger an authorization instruction to determine the QQ account logged in the QQ program on the mobile phone as the selected account. For another example, the authorization confirmation information may include a login page of the QQ, and the user inputs a user name and a password of the QQ in the login page, and may trigger the authorization instruction after clicking the confirmation, and determine the account corresponding to the user name as the selected account.
Step S105, if the authorization instruction is received, the authorization instruction is sent to the server of the third-party platform, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
In this embodiment, after the third-party platform server verifies that the selected account of the third-party platform authorized by the user is legal according to the authorization instruction, for example, after the account and the password information are verified, the user information corresponding to the selected account may be sent to the first port of the local service, that is, the user successfully logs in the website using the selected account of the third-party platform. The user information includes, but is not limited to, a nickname of the user on the third-party platform, a user avatar, personal data, and other information.
As can be seen from the above embodiments of the present invention, the present invention first receives a third party login instruction for logging in a website triggered by a user in a browser, and obtains an address identifier of the website; then judging whether the address identifier of the website is mapped to a first port of the local service according to a set address mapping rule; if so, sending the third-party login instruction to a first port of the local service so that the local service sends a verification request comprising the address identifier of the website to a server of the third-party platform; receiving authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompting whether the user triggers an authorization instruction or not according to the authorization confirmation information; and if the authorization instruction is received, sending the authorization instruction to a server of the third-party platform, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction. Therefore, in the development joint debugging stage that the website is not formally on-line, the embodiment of the invention can use the address identifier after the website is on-line to access the website built in the local service in the browser according to the set address mapping rule; the third party login instruction can be received through the first port of the local service, and the verification request including the address identifier after the website is on line is sent to the server of the third party platform instead of the address identifier of the local service, so that the third party platform server can perform related verification before user information is sent according to the address identifier after the website is on line.
Example two
Fig. 2 shows a flowchart of a user information acquisition method according to a second embodiment of the present invention. As shown in fig. 2, the method for acquiring user information according to the embodiment of the present invention includes the following steps:
step S201, setting the address of the proxy server of the browser as the address identifier of the local service, setting the port of the proxy server of the browser as the second port of the local service, and monitoring the second port of the local service.
In this embodiment, after the proxy server address of the browser is set as the address identifier of the local service and the proxy server port of the browser is set as the second port of the local service, all request links of the browser are forwarded to the second port of the local service. Therefore, after a third-party login instruction of logging in the website triggered by the user in the browser is received, the third-party login instruction is sent to the second port of the local service, so that whether the third-party login instruction is triggered by the user in the browser or not can be determined by monitoring the second port of the local service, and the address identifier of the website is obtained.
Optionally, in order to conveniently and quickly access the website built in the local service by using the address identifier after the website is online, an address mapping rule may be set by using a tool having an address mapping function, such as charles, and the second port of the local service is monitored, so that in subsequent steps, whether the address identifier of the website needs to be mapped to the first port of the local service may be determined according to the set address mapping rule.
In this embodiment, any unoccupied port of the local service may be configured as the second port. Optionally, a port scan may be performed on the local service to determine at least one unoccupied port of the local service, and the unoccupied port of one local service may be configured as a second port of the local service.
Step S202, a third party login instruction of logging in the website triggered by the user in the browser is received, the third party login instruction is sent to a second port of the local service, and the address identification of the website is obtained.
Step S203, according to the set address mapping rule, judging whether the address identifier of the website is mapped to the first port of the local service, wherein the website built on the local service can be accessed through the first port of the local service.
In this embodiment, in order to access a website built in a local service by using an online address identifier of the website, the method may include: and modifying the IP address corresponding to the online address identifier of the website into the IP address of the local service, such as 127.0.0.1, in the local Hosts file, and fixing the first port of the local service as 80 ports.
Hosts is a system file without extension name, can be opened by using tools such as a notebook and the like, and has the functions of establishing a relevant 'database' between some common domain names and IP addresses corresponding to the domain names, when a user inputs a domain name needing to be accessed in a browser, the corresponding IP address is automatically searched from the Hosts file, once the domain name is found, the corresponding page is accessed according to the IP address, and if the domain name is not found, the domain name is submitted to a DNS domain name resolution server for IP address resolution so as to obtain the corresponding IP address.
In this embodiment, the method may further include: the method comprises the steps of carrying out port scanning on a local service to determine at least one unoccupied port of the local service, and configuring the unoccupied port of one local service as a first port of the local service. Compared with modifying the local Hosts file, any unoccupied port of the local service can be configured as the first port in this way, i.e. the first port is not limited to 80 ports, so that the selection of the first port is more flexible.
Step S204, if yes, the third party login instruction is forwarded to the first port of the local service from the second port of the local service, so that the local service sends a verification request including the address identifier of the website to the server of the third party platform.
In this embodiment, because the third party login instruction is sent to the second port of the local service, if it is determined that the address identifier of the website needs to be mapped to the first port of the local service according to the set address mapping rule, that is, the website is built on the local service, the third party login instruction may be forwarded to the first port of the local service from the second port of the local service.
Optionally, if it is determined that the address identifier of the website is not required to be mapped to the first port of the local service according to the set address mapping rule, that is, the website is not built on the local service, the third party login instruction may be sent to the server of the website through the second port of the local service according to the address identifier of the website.
In this embodiment, since the specifications of different third party platforms for the sending party of the verification request may be different, the verification request may be directly sent to the server of the third party platform through the first port by the local service, or the local service may trigger the browser to send the verification request. When it is required to send a verification request to the server of the third party platform through the browser, step S204 may include the following sub-steps:
and a substep S204a, receiving verification information returned by the local service from the first port according to the third party login request, wherein the verification information comprises the address identification of the server of the third party platform and the address identification of the website.
Sub-step S204b, sending a verification request including the address identifier of the website to the server of the third party platform according to the address identifier of the server of the third party platform.
Optionally, the verification information may be a redirection address, so that the redirection address may be accessed by the browser to send a verification request to the server of the third party platform.
For example, when the online address of the website built on the local service is 1234567 and the server of the third-party platform is a server of the QQ, the local service may return a redirection address "http:// www.qq.com/authority? Www.1234567.com/callback ", so that the browser can directly access the address to send a verification request to the server of the third party platform.
Step S205, receiving authorization confirmation information returned by the server of the third party platform according to the verification request, and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to use a selected account of the third party platform to log in the website.
Step S206, if the authorization instruction is received, the authorization instruction is sent to the server of the third-party platform, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
In this embodiment, in order to improve security, after receiving the authorization instruction and verifying that the selected account is legal, the server of the third-party platform returns an authorization code that is valid in a short time, for example, within 10 minutes, to the sender of the verification request. The local service can receive an authorization token distributed by the server of the third-party platform according to the token acquisition request only by acquiring the authorization code and sending the token acquisition request including the authorization code to the server of the third-party platform through the first port, wherein the authorization token is used for requesting the server of the third-party platform to acquire the user information corresponding to the selected account through the first port by the local service.
For example, the server of the QQ may distribute the identifier of the selected QQ account and the authorization token to the first port of the local service, so that the local service may request to acquire the user information corresponding to the selected QQ account by using the identifier of the selected QQ account and the authorization token through the first port, and after the server of the QQ verifies that the identifier of the selected QQ account and the authorization token are legal, the server of the QQ may send the user information corresponding to the selected QQ account to the first port of the local service.
Alternatively, if the local service directly sends the verification request to the server of the third party platform through the first port in step S204, the local service may directly receive the authorization code returned by the third party server through the first port.
Alternatively, if the browser sends the authentication request to the server of the third-party platform in step S204, step S206 includes: sending an authorization instruction to a server of the third-party platform, and receiving an authorization code returned by the server of the third-party platform according to the authorization instruction; the authorization code is sent to a first port of the local service.
As can be seen from the above embodiments of the present invention, the address of the proxy server of the browser is set as the address identifier of the local service, and the port of the proxy server of the browser is set as the second port of the local service, so that all request links of the browser are forwarded to the second port of the local service, and thus, whether a user triggers a third-party login instruction in the browser can be determined by monitoring the second port of the local service, and the address identifier of the website is obtained; the method comprises the steps of carrying out port scanning on the local service to determine at least one unoccupied port of the local service, and configuring the unoccupied port of one local service as a first port of the local service, so that the configuration of the first port is more flexible.
EXAMPLE III
Fig. 3 is a block diagram showing a configuration of a user information acquisition apparatus according to a third embodiment of the present invention. As shown in fig. 3, an apparatus for acquiring user information according to a third embodiment of the present invention includes:
the instruction receiving module 301 is configured to receive a third-party login instruction for logging in a website, which is triggered by a user in a browser, and acquire an address identifier of the website.
The mapping module 302 is configured to determine whether the address identifier of the website is mapped to the first port of the local service according to a set address mapping rule, where the website built on the local service is accessible through the first port of the local service.
A first sending module 303, configured to send the third party login instruction to the first port of the local service if the third party login instruction is received, so that the local service sends the authentication request including the address identifier of the website to the server of the third party platform.
And the receiving module 304 is configured to receive authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompt the user whether to trigger an authorization instruction according to the authorization confirmation information, where the authorization instruction is used to indicate that the user is authorized to log in the website using the selected account of the third-party platform.
The second sending module 305 is configured to send the authorization instruction to the server of the third party platform if the authorization instruction is received, so that the server of the third party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
In this embodiment, the method further includes: and the monitoring module 306 is configured to set the proxy server address of the browser as the address identifier of the local service, set the proxy server port of the browser as the second port of the local service, and monitor the second port of the local service.
Correspondingly, the first sending module 303 is further configured to forward the third party login instruction from the second port of the local service to the first port of the local service.
In this embodiment, the method further includes: the scanning module 307 is configured to perform port scanning on the local service to determine at least one unoccupied port of the local service, and configure the unoccupied port of one local service as a first port of the local service.
In this embodiment, the first sending module 303 is further configured to receive verification information returned by the local service from the first port according to the third party login request, where the verification information includes an address identifier of a server of the third party platform and an address identifier of the website;
and sending a verification request comprising the address identifier of the website to the server of the third-party platform according to the address identifier of the server of the third-party platform.
By the user information obtaining apparatus of this embodiment, the corresponding user information obtaining method in the foregoing multiple method embodiments can be implemented, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
Example four
The present invention also provides a computer storage medium having stored therein:
the instruction is used for receiving a third-party login instruction which is triggered by a user in a browser and used for logging in a website and acquiring an address identifier of the website;
the instruction is used for judging whether the address identifier of the website is mapped to the first port of the local service according to the set address mapping rule, wherein the instruction of the website built on the local service can be accessed through the first port of the local service;
if so, sending a third party login instruction to a first port of the local service so that the local service sends a verification request comprising the address identification of the website to a server of the third party platform;
the server is used for receiving authorization confirmation information returned by the server of the third-party platform according to the verification request and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to use a selected account number of the third-party platform to log in a website;
and if the authorization instruction is received, sending the authorization instruction to a server of the third-party platform, so that the server of the third-party platform sends the instruction of the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
In this embodiment, the method further includes: instructions for setting the address of the proxy server of the browser as the address identifier of the local service, setting the port of the proxy server of the browser as the second port of the local service, and monitoring the second port of the local service;
instructions for forwarding the third party login instruction from the second port of the local service to the first port of the local service.
In this embodiment, the method further includes: instructions for performing a port scan on the local service to determine at least one unoccupied port of the local service, and configuring the unoccupied port of one local service as a first port of the local service.
In this embodiment, the method further includes: the authentication information comprises an instruction of an address identifier of a server of the third-party platform and an address identifier of the website;
and sending a verification request comprising the address identification of the website to the server of the third-party platform according to the address identification of the server of the third-party platform.
In this embodiment, the method further includes: the server is used for sending an authorization instruction to the third-party platform and receiving an instruction of an authorization code returned by the server of the third-party platform according to the authorization instruction;
the authorization method includes sending an authorization code to a first port of a local service, so that the local service sends a token acquisition request including the authorization code to a server of a third-party platform through the first port, and receiving an authorization token distributed by the server of the third-party platform according to the token acquisition request, where the authorization token is used for the local service to request the server of the third-party platform to acquire an instruction of user information corresponding to a selected account through the first port.
The computer storage medium of this embodiment can implement the code location method for the corresponding test case in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the user information acquisition methods described herein. Further, when a general-purpose computer accesses code for implementing the acquisition method of user information shown herein, execution of the code converts the general-purpose computer into a special-purpose computer for executing the acquisition method of user information shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.

Claims (10)

1. A method for acquiring user information is characterized by comprising the following steps:
receiving a third-party login instruction for logging in a website triggered by a user in a browser, and acquiring an address identifier of the website;
judging whether the address identifier of the website is mapped to a first port of a local service according to a set address mapping rule, wherein the website built on the local service can be accessed through the first port of the local service;
if so, sending the third party login instruction to a first port of the local service so that the local service sends a verification request comprising the address identifier of the website to a server of the third party platform;
receiving authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to log in the website by using a selected account of the third-party platform;
and if the authorization instruction is received, sending the authorization instruction to a server of the third-party platform, so that the server of the third-party platform sends user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
2. The method of claim 1, further comprising:
setting the address of the proxy server of the browser as the address identifier of the local service, setting the port of the proxy server of the browser as the second port of the local service, and monitoring the second port of the local service;
correspondingly, the sending the third party login instruction to the first port of the local service includes:
forwarding the third party login instruction from the second port of the local service to the first port of the local service.
3. The method of claim 1, further comprising:
and carrying out port scanning on the local service to determine at least one unoccupied port of the local service, and configuring the unoccupied port of one local service as a first port of the local service.
4. The method of claim 1, wherein causing the local service to send a validation request comprising an address identification of the website to a server of the third party platform comprises:
receiving verification information returned by the local service from the first port according to the third party login request, wherein the verification information comprises an address identifier of a server of a third party platform and an address identifier of the website;
and sending a verification request comprising the address identifier of the website to the server of the third-party platform according to the address identifier of the server of the third-party platform.
5. The method of claim 4, wherein the sending the authorization instruction to the server of the third party platform, so that the server of the third party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction comprises:
sending the authorization instruction to a server of the third-party platform, and receiving an authorization code returned by the server of the third-party platform according to the authorization instruction;
sending the authorization code to a first port of the local service, so that the local service sends a token acquisition request including the authorization code to a server of the third-party platform through the first port, and receives an authorization token distributed by the server of the third-party platform according to the token acquisition request, wherein the authorization token is used for the local service to request the server of the third-party platform to acquire user information corresponding to the selected account through the first port.
6. An apparatus for acquiring user information, comprising:
the instruction receiving module is used for receiving a third-party login instruction which is triggered by a user in a browser and used for logging in a website and acquiring an address identifier of the website;
the mapping module is used for judging whether the address identifier of the website is mapped to a first port of a local service according to a set address mapping rule, wherein the website built on the local service can be accessed through the first port of the local service;
a first sending module, configured to send the third-party login instruction to a first port of the local service if the third-party login instruction is received, so that the local service sends a verification request including an address identifier of the website to a server of the third-party platform;
a receiving module, configured to receive authorization confirmation information returned by the server of the third-party platform according to the verification request, and prompt the user whether to trigger an authorization instruction according to the authorization confirmation information, where the authorization instruction is used to indicate that the user is authorized to log in the website using a selected account of the third-party platform;
and the second sending module is used for sending the authorization instruction to the server of the third-party platform if the authorization instruction is received, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
7. The apparatus of claim 6, further comprising:
the monitoring module is used for setting the address of the proxy server of the browser as the address identifier of the local service, setting the port of the proxy server of the browser as the second port of the local service, and monitoring the second port of the local service;
correspondingly, the first sending module is further configured to forward the third party login instruction from the second port of the local service to the first port of the local service.
8. The apparatus of claim 6, further comprising:
the scanning module is used for carrying out port scanning on the local service so as to determine at least one unoccupied port of the local service, and configuring the unoccupied port of one local service as a first port of the local service.
9. The apparatus of claim 6, wherein the first sending module is further configured to receive authentication information returned by the local service from the first port according to the third party login request, wherein the authentication information includes an address identifier of a server of a third party platform and an address identifier of the website;
and sending a verification request comprising the address identifier of the website to the server of the third-party platform according to the address identifier of the server of the third-party platform.
10. A computer storage medium, comprising stored therein:
the instruction is used for receiving a third-party login instruction which is triggered by a user in a browser and used for logging in a website and acquiring an address identifier of the website;
instructions for determining whether the address identifier of the website is mapped to a first port of a local service according to a set address mapping rule, wherein the website built on the local service can be accessed through the first port of the local service;
if so, sending the third party login instruction to a first port of the local service to enable the local service to send a verification request comprising the address identification of the website to a server of the third party platform;
the server used for receiving the authorization confirmation information returned by the server of the third-party platform according to the verification request and prompting whether the user triggers an authorization instruction according to the authorization confirmation information, wherein the authorization instruction is used for indicating that the user is authorized to use a selected account of the third-party platform to log in the website;
and sending the authorization instruction to the server of the third-party platform if the authorization instruction is received, so that the server of the third-party platform sends the user information corresponding to the selected account to the first port of the local service according to the authorization instruction.
CN201910307117.7A 2019-04-17 2019-04-17 User information acquisition method and device and computer storage medium Active CN111835677B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910307117.7A CN111835677B (en) 2019-04-17 2019-04-17 User information acquisition method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910307117.7A CN111835677B (en) 2019-04-17 2019-04-17 User information acquisition method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN111835677A true CN111835677A (en) 2020-10-27
CN111835677B CN111835677B (en) 2022-03-22

Family

ID=72914661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910307117.7A Active CN111835677B (en) 2019-04-17 2019-04-17 User information acquisition method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN111835677B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102624728A (en) * 2012-03-09 2012-08-01 浙江大学城市学院 Method and system for carrying out whole-network login authentication by utilizing registered website user information
US20140096205A1 (en) * 2011-11-23 2014-04-03 Tencent Technology (Shenzhen) Company Limited Login method, open platform identification method, open platform and open platform system
CN104348777A (en) * 2013-07-24 2015-02-11 腾讯科技(深圳)有限公司 Method and system for controlling access of mobile terminal to third party server
CN105897668A (en) * 2015-10-22 2016-08-24 乐视致新电子科技(天津)有限公司 Third party account authorization method, device, server and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140096205A1 (en) * 2011-11-23 2014-04-03 Tencent Technology (Shenzhen) Company Limited Login method, open platform identification method, open platform and open platform system
CN102624728A (en) * 2012-03-09 2012-08-01 浙江大学城市学院 Method and system for carrying out whole-network login authentication by utilizing registered website user information
CN104348777A (en) * 2013-07-24 2015-02-11 腾讯科技(深圳)有限公司 Method and system for controlling access of mobile terminal to third party server
CN105897668A (en) * 2015-10-22 2016-08-24 乐视致新电子科技(天津)有限公司 Third party account authorization method, device, server and system

Also Published As

Publication number Publication date
CN111835677B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN112929326B (en) Malicious domain name access detection method and device and computer readable storage medium
CN107666413B (en) Method and device for testing communication security of device under test
CN105847245B (en) Electronic mailbox login authentication method and device
CN107395593B (en) Vulnerability automatic protection method, firewall and storage medium
CN110430205B (en) Single sign-on method, device, equipment and computer readable storage medium
CN107040518B (en) Private cloud server login method and system
CN113676336B (en) Microservice access proxy method, apparatus and storage medium
CN113381979B (en) Access request proxy method and proxy server
CN111783096B (en) Method and device for detecting security hole
CN111431753A (en) Asset information updating method, device, equipment and storage medium
CN110740191B (en) Resource access method, device, electronic equipment and storage medium
CN110798446B (en) Mail batch authorization method and device, computer equipment and storage medium
CN110572390A (en) Method, device, computer equipment and storage medium for detecting domain name hijacking
CN112235321B (en) Short message verification code anti-brushing method and device
CN107294910B (en) Login method and server
CN109688096B (en) IP address identification method, device, equipment and computer readable storage medium
CN108418809B (en) Chat data processing method and device, computer equipment and storage medium
CN114499974A (en) Device detection method, device, computer device and storage medium
CN111835677B (en) User information acquisition method and device and computer storage medium
CN113411333A (en) Unauthorized access vulnerability detection method, device, system and storage medium
CN117251837A (en) System access method and device, electronic equipment and storage medium
CN114585055B (en) Vehicle-mounted WiFi access method, vehicle controller, cloud server and mobile terminal
CN114157472B (en) Network access control method, device, equipment and storage medium
JP6124603B2 (en) Information access system and method
CN111738388B (en) Parameter configuration method and device of measuring instrument, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant