CN113014588A - Authentication processing method for multiple application systems under same main domain name - Google Patents

Authentication processing method for multiple application systems under same main domain name Download PDF

Info

Publication number
CN113014588A
CN113014588A CN202110244325.4A CN202110244325A CN113014588A CN 113014588 A CN113014588 A CN 113014588A CN 202110244325 A CN202110244325 A CN 202110244325A CN 113014588 A CN113014588 A CN 113014588A
Authority
CN
China
Prior art keywords
token
xxx
login
userid
cookie
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
CN202110244325.4A
Other languages
Chinese (zh)
Other versions
CN113014588B (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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information 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 Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202110244325.4A priority Critical patent/CN113014588B/en
Publication of CN113014588A publication Critical patent/CN113014588A/en
Application granted granted Critical
Publication of CN113014588B publication Critical patent/CN113014588B/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/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The invention provides an authentication processing method of multiple application systems under the same main domain name, belonging to the technical field of user authority. The method solves the problem of consistency of login and logout of different components in the service system, avoids the defects of login confusion, authentication failure, circular login and the like among different service systems, and improves the login and authentication success rate.

Description

Authentication processing method for multiple application systems under same main domain name
Technical Field
The invention relates to the technical field of user permission, in particular to an authentication processing method of multiple application systems under the same main domain name.
Background
With the development of cloud computing and big data technology, the development of the internet + is more and more rapid. The content of the internet + facing the inside and outside of a department is more and more, and the same unit is involved in various service fields, so that a plurality of branches are often established in one unit, each branch supports different services, but the web application of the application system of each service branch has the same first-level domain name to the outside, and different service systems are distinguished only by second-level domain names or even third-level domain names.
However, how to solve the problem of user authentication isolation among a plurality of application systems under the same main domain name and how to ensure the consistency of user authentication in each system becomes a problem to be solved in the first place and the second place, which belong to application systems of the same organization and different systems.
Disclosure of Invention
In order to solve the technical problem, the invention provides an authentication processing method for multiple application systems under the same home domain name.
The technical scheme of the invention is as follows:
an authentication processing method for multiple application systems under the same main domain name,
the method comprises the steps that authentication is carried out based on a Token, the Token is a string of character strings generated by a server side and used as a Token requested by a client side, after login is carried out for the first time, the server generates the Token and returns the Token to the client side, and the client side only needs to take the Token to request data before later, and does not need to take a user name and a password again.
Further, in the above-mentioned case,
the method comprises the following steps:
(1) the user token and the user information/login state are stored separately;
(2) storing the token information of the user into sessionstorage;
(3) storing the user information/login state to the shared cookie;
(4) inquiring login user information and login state before sending a request to a background every time, and ensuring that a logged-in user does not need to log in again;
(5) automatically clearing sessionstorage and cookie when quitting, and setting a quit tag in localStorage;
(6) and monitoring an exit event to ensure that the components of different tab pages can exit in a linkage manner.
Still further, the concrete steps are as follows:
1) related token related information related to login and authority authentication is stored in sessionstore, and comprises XXX _ token (XXX integrated system configuration is configured to XXX _ token) and refresh _ token. The sessionStorage message is not permanent and is automatically cleared when the page closes.
2) Two shared cookies, isLogiinValid and userId, are set under the primary domain name. The name prefixes of the 2 cookies isLoginValid and userld are configurable, such as XXX integration systems are configured to: XXX, then the cookie name for isLoginValid is XXX _ login _ isLoginValid and the cookie name for userId is XXX _ userId. The purpose is to share current user information and login status.
3) When login is successful, the cookie value of XXX _ login _ isLoginValid is set to true, and XXX _ userId is set to userId of the user. This allows the login status to be shared even if the browser opens multiple tabs. When the login fails or exits, the cookie is deleted.
4) Inquiring the values of XXX _ login _ isLoginValid and XXX _ userId before sending a request to the background each time, judging that the current user is in an exit state if the current user is inconsistent with the XXX _ userId and the XXX _ login _ isLoginValid does not exist, and redirecting to a login page.
5) And when exiting, actively cleaning the values written in the sessionStorage and the shared cookie, and ensuring that the terminal is in an exiting state when operating, logging in and refreshing next time.
6) In order to realize exit linkage between components of different tab pages, the front end of each component is required to monitor exit by using an onstorage event of window. Provided that each component is required to set a flag bit into the localStorage upon exit.
Further, in the above-mentioned case,
the login process specifically comprises the following steps:
1) the method for providing the front-end public package comprises the steps of firstly judging whether xxx _ token and refresh _ token in sessionstore exist or not, and jumping to a login page if the xxx _ token and refresh _ token do not exist;
2) a timer 1 is arranged in the front-end public packet, and the login state is refreshed regularly; if the login state is invalid, jumping to a login page; if the login state is valid and the current userId is consistent with the current userId in the cookie, directly logging in;
3) a timer 2 is arranged in the front-end public packet, token information is refreshed regularly, and whether the token is overdue or not is judged; if yes, reapplying xxx _ token by using refresh _ token, and assigning the access _ token and refresh _ token returned by the authentication background to the xxx _ token and the refresh _ token respectively;
4) after login of the login page is successful, assigning an access _ token and a refresh _ token returned by the background to the xxx _ token and the refresh _ token respectively;
5) and after the login page is successfully logged in, setting XXX _ login _ isLoginValid in the cookie as true, and writing XXX _ userId into the user ID.
The exiting process specifically comprises the following steps:
when the user logs off:
1) the front-end public packet firstly empties xxx _ token and refresh _ token in sessionstore;
2) secondly, clearing XXX _ logic _ isLoginValid and XXX _ userId in the shared cookie;
3) finally, setting the position of logOut mark in localStorage as false.
The multi-tab component exit linkage process specifically comprises the following steps:
1) the front-end public packet provides an event monitoring mechanism and monitors a logOut flag bit in localStorage;
2) if the logOut flag bit is true, other components automatically quit, otherwise, monitoring is continued.
The invention has the advantages that
(1) The isolation of user authentication between multiple systems under the same main domain name is guaranteed;
(2) the consistency of login authentication between different components in the system under the same main domain name is solved;
(3) the user experience of multi-system users under the same main domain name is improved.
Drawings
FIG. 1 is a schematic workflow diagram of the present invention;
FIG. 2 is a schematic exit flow diagram of the present invention;
FIG. 3 is a schematic linkage flow diagram of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
The token and other information used by the login authority of the integrated system A exist in the cookie at present, and the login information exists in a higher-level domain name because all components integrated by the integrated system A are respectively deployed and the login state needs to be synchronized among the components. For example, the domain name of the a integration system is console.a.company.com, and the information exists under the domain name of the company.com, the domain name of the a1 service is a.1.a.company.com, and the information also exists under the domain name of the company.com, so that the sharing of the login related information is realized between the a integration system and the integrated component.
However, at present, a service line is added, a B integrated system is developed, a domain name deployed by the B system is console.b.company.com, and information also exists under the company.com domain name, so that cookie information of the a integrated system and the B integrated system is disordered and mutually covered, and the two platforms have the phenomena of login confusion, authentication failure, circular login and the like.
The method comprises the following specific steps:
1) related token related information related to login and authority authentication is stored in sessionstore, and comprises XXX _ token (XXX integrated system configuration is configured to XXX _ token) and refresh _ token. The sessionStorage message is not permanent and is automatically cleared when the page closes.
2) Two shared cookies, isLogiinValid and userId, are set under the primary domain name. The name prefixes of the 2 cookies isLoginValid and userld are configurable, such as XXX integration systems are configured to: XXX, then the cookie name for isLoginValid is XXX _ login _ isLoginValid and the cookie name for userId is XXX _ userId. The purpose is to share current user information and login status.
3) When login is successful, the cookie value of XXX _ login _ isLoginValid is set to true, and XXX _ userId is set to userId of the user. This allows the login status to be shared even if the browser opens multiple tabs. When the login fails or exits, the cookie is deleted.
4) Inquiring the values of XXX _ login _ isLoginValid and XXX _ userId before sending a request to the background each time, judging that the current user is in an exit state if the current user is inconsistent with the XXX _ userId and the XXX _ login _ isLoginValid does not exist, and redirecting to a login page.
5) And when exiting, actively cleaning the values written in the sessionStorage and the shared cookie, and ensuring that the terminal is in an exiting state when operating, logging in and refreshing next time.
6) In order to realize exit linkage between components of different tab pages, the front end of each component is required to monitor exit by using an onstorage event of window. Provided that each component is required to set a flag bit into the localStorage upon exit.
The invention mainly considers the problems of authentication and login quit among different service systems under the same first-level domain name but belonging to different second-level, third-level and even multi-level domain names. Therefore, the problem of consistency of login and logout of different components in the service system and the problem of 400 caused by overlarge request Header are solved, the defects of login confusion, authentication failure, circular login and the like among different service systems are overcome, the login and authentication success rate is improved, and the user experience is improved.
The login process is shown in fig. 1:
1) the method for providing the front-end public package comprises the steps of firstly judging whether xxx _ token and refresh _ token in sessionstore exist or not, and jumping to a login page if the xxx _ token and refresh _ token do not exist;
2) the timer 1 is arranged in the front-end public packet, and the login state is regularly refreshed. If the login state is invalid, jumping to a login page; if the login state is valid and the current userId is consistent with the current userId in the cookie, directly logging in;
3) and a timer 2 is arranged in the front-end public packet, so that token information is regularly refreshed, and whether the token is overdue or not is judged. If yes, reapplying xxx _ token by using refresh _ token, and assigning the access _ token and refresh _ token returned by the authentication background to the xxx _ token and the refresh _ token respectively;
4) after login of the login page is successful, assigning an access _ token and a refresh _ token returned by the background to the xxx _ token and the refresh _ token respectively;
5) and after the login page is successfully logged in, setting XXX _ login _ isLoginValid in the cookie as true, and writing XXX _ userId into the user ID.
Exit the flow, as shown in fig. 2:
when the user logs off:
1) the front-end public packet firstly empties xxx _ token and refresh _ token in sessionstore;
2) secondly, clearing XXX _ logic _ isLoginValid and XXX _ userId in the shared cookie;
3) finally, setting the position of logOut mark in localStorage as false.
(3) And (3) the multi-tab component exits the linkage flow:
when components of different tab pages are opened in the integrated system, in order to ensure that one of the components exits, other components also exit, a linkage process is designed, as shown in fig. 3: :
1) the front-end public packet provides an event monitoring mechanism and monitors a logOut flag bit in localStorage;
2) if the logOut flag bit is true, other components automatically quit, otherwise, monitoring is continued.
The above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. An authentication processing method of multiple application systems under the same main domain name is characterized in that,
the method comprises the steps that authentication is carried out based on a Token, the Token is a string of character strings generated by a server side and used as a Token requested by a client side, after login is carried out for the first time, the server generates the Token and returns the Token to the client side, and the client side only needs to take the Token to request data before later, and does not need to take a user name and a password again.
2. The method of claim 1,
the method comprises the following steps:
(1) the user token and the user information/login state are stored separately;
(2) storing the token information of the user into sessionstorage;
(3) storing the user information/login state to the shared cookie;
(4) inquiring login user information and login state before sending a request to a background every time, and ensuring that a logged-in user does not need to log in again;
(5) automatically clearing sessionstorage and cookie when quitting, and setting a quit tag in localStorage;
(6) and monitoring an exit event to ensure that the components of different tab pages can exit in a linkage manner.
3. The method of claim 1,
the method comprises the following specific steps:
1) related token related information related to login and authority authentication is stored in sessionstore and comprises XXX _ token (XXX integrated system configuration is configured to XXX _ token) and refresh _ token;
2) two shared cookies, isLogiinValid and userId, are set under the primary domain name. The name prefixes of the 2 cookies isLoginValid and userld are configurable;
when the XXX integration system is configured to: XXX, the cookie name of isLoginValid is XXX _ login _ isLoginValid, and the cookie name of userId is XXX _ userId; the purpose is to share the current user information and the login state;
3) after login is successful, setting the cookie value of XXX _ login _ isLoginValid as true, and setting XXX _ userId as userId of the user; thus, even if the browser opens a plurality of tabs, the login state can be shared; deleting the cookie when the login is invalid or quit;
4) inquiring the values of XXX _ logic _ isLoginValid and XXX _ userId before sending a request to the background each time, judging that the current user is in an exit state if the current user is inconsistent with the XXX _ userId and the XXX _ logic _ isLoginValid does not exist, and redirecting to a login page;
5) when exiting, the written values in the sessionStorage and the shared cookie are actively cleaned, and the state of exiting is guaranteed when next operation, login and refreshing are carried out;
6) in order to realize exit linkage between components of different tab pages, the front end of each component is required to monitor exit by using an onstorage event of window.
4. The method of claim 3,
the sessionStorage information in step 1) is not permanent and is automatically cleared when the page is closed.
5. The method of claim 3,
exit linkage requires each component to set a flag bit into the localStorage at the time of exit.
6. The method of claim 3,
the login process specifically comprises the following steps:
1) the method for providing the front-end public package comprises the steps of firstly judging whether xxx _ token and refresh _ token in sessionstore exist or not, and jumping to a login page if the xxx _ token and refresh _ token do not exist;
2) a timer 1 is arranged in the front-end public packet, and the login state is refreshed regularly; if the login state is invalid, jumping to a login page; if the login state is valid and the current userId is consistent with the current userId in the cookie, directly logging in;
3) a timer 2 is arranged in the front-end public packet, token information is refreshed regularly, and whether the token is overdue or not is judged; if yes, reapplying xxx _ token by using refresh _ token, and assigning the access _ token and refresh _ token returned by the authentication background to the xxx _ token and the refresh _ token respectively;
4) after login of the login page is successful, assigning an access _ token and a refresh _ token returned by the background to the xxx _ token and the refresh _ token respectively;
5) and after the login page is successfully logged in, setting XXX _ login _ isLoginValid in the cookie as true, and writing XXX _ userId into the user ID.
7. The method of claim 6,
the exiting process specifically comprises the following steps:
when the user logs off:
1) the front-end public packet firstly empties xxx _ token and refresh _ token in sessionstore;
2) secondly, clearing XXX _ logic _ isLoginValid and XXX _ userId in the shared cookie;
3) finally, setting the position of logOut mark in localStorage as false.
8. The method of claim 5,
the multi-tab component exit linkage process specifically comprises the following steps:
1) the front-end public packet provides an event monitoring mechanism and monitors a logOut flag bit in localStorage;
2) if the logOut flag bit is true, other components automatically quit, otherwise, monitoring is continued.
CN202110244325.4A 2021-03-05 2021-03-05 Authentication processing method for multiple application systems under same main domain name Active CN113014588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110244325.4A CN113014588B (en) 2021-03-05 2021-03-05 Authentication processing method for multiple application systems under same main domain name

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110244325.4A CN113014588B (en) 2021-03-05 2021-03-05 Authentication processing method for multiple application systems under same main domain name

Publications (2)

Publication Number Publication Date
CN113014588A true CN113014588A (en) 2021-06-22
CN113014588B CN113014588B (en) 2022-04-12

Family

ID=76406506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110244325.4A Active CN113014588B (en) 2021-03-05 2021-03-05 Authentication processing method for multiple application systems under same main domain name

Country Status (1)

Country Link
CN (1) CN113014588B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110119747A1 (en) * 2009-11-17 2011-05-19 Mark Lambiase Single sign on with multiple authentication factors
CN110177120A (en) * 2019-06-14 2019-08-27 北京首都在线科技股份有限公司 A kind of method, apparatus and computer readable storage medium of single-sign-on
CN110611660A (en) * 2019-08-22 2019-12-24 山东浪潮通软信息科技有限公司 Enterprise-level multi-domain-name login integration method
CN110933084A (en) * 2019-11-29 2020-03-27 深圳乐信软件技术有限公司 Cross-domain shared login state method, device, terminal and storage medium
CN111628965A (en) * 2020-04-03 2020-09-04 北京奇艺世纪科技有限公司 Cross-domain name login method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110119747A1 (en) * 2009-11-17 2011-05-19 Mark Lambiase Single sign on with multiple authentication factors
CN110177120A (en) * 2019-06-14 2019-08-27 北京首都在线科技股份有限公司 A kind of method, apparatus and computer readable storage medium of single-sign-on
CN110611660A (en) * 2019-08-22 2019-12-24 山东浪潮通软信息科技有限公司 Enterprise-level multi-domain-name login integration method
CN110933084A (en) * 2019-11-29 2020-03-27 深圳乐信软件技术有限公司 Cross-domain shared login state method, device, terminal and storage medium
CN111628965A (en) * 2020-04-03 2020-09-04 北京奇艺世纪科技有限公司 Cross-domain name login method and device

Also Published As

Publication number Publication date
CN113014588B (en) 2022-04-12

Similar Documents

Publication Publication Date Title
US6173311B1 (en) Apparatus, method and article of manufacture for servicing client requests on a network
US6442588B1 (en) Method of administering a dynamic filtering firewall
US8131861B2 (en) Method for cross-domain tracking of web site traffic
KR101099238B1 (en) Architecture for connecting a remote client to a local client desktop
US7536392B2 (en) Network update manager
US7506055B2 (en) System and method for filtering of web-based content stored on a proxy cache server
US8769629B2 (en) User sensitive filtering of network application layer
US7484012B2 (en) User enrollment in an e-community
US6304906B1 (en) Method and systems for allowing data service system to provide class-based services to its users
JPH10254807A (en) Method for reading server site anonymously
US20040003084A1 (en) Network resource management system
US20120297478A1 (en) Method and system for preventing dns cache poisoning
Vixie DNS and BIND Security Issues.
US6453317B1 (en) Customer information storage and delivery system
CN103404103A (en) System and method for combining an access control system with a traffic management system
CN103095676A (en) Filtrating system and filtrating method
CN104395894A (en) Relay device and control method for relay device
CN108429743A (en) A kind of security policy configuration method, system, domain control server and firewall box
CN113014588B (en) Authentication processing method for multiple application systems under same main domain name
JP4356693B2 (en) Message delivery apparatus and method, system and program thereof
US20020194295A1 (en) Scalable data-sharing architecture
KR20060004625A (en) Service system of the realtime guidance and conversation offered connecting persons for make sure customer of the website operator
US6553421B1 (en) Method and system for broadcast management in a data communication network that permits namesharing
US7509339B2 (en) System and method of implementing personalized alerts utilizing a user registry in instant messenger
WO2000000904A1 (en) Method and apparatus for providing a connect-on-demand server in a data processing network

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