CN109218389B - Method, device and storage medium for processing service request and electronic equipment - Google Patents

Method, device and storage medium for processing service request and electronic equipment Download PDF

Info

Publication number
CN109218389B
CN109218389B CN201810731981.5A CN201810731981A CN109218389B CN 109218389 B CN109218389 B CN 109218389B CN 201810731981 A CN201810731981 A CN 201810731981A CN 109218389 B CN109218389 B CN 109218389B
Authority
CN
China
Prior art keywords
client
single sign
ajax
authentication
request message
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.)
Active
Application number
CN201810731981.5A
Other languages
Chinese (zh)
Other versions
CN109218389A (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.)
Xi'an Gewu Medical Technology Co ltd
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201810731981.5A priority Critical patent/CN109218389B/en
Publication of CN109218389A publication Critical patent/CN109218389A/en
Application granted granted Critical
Publication of CN109218389B publication Critical patent/CN109218389B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • 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/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本公开涉及一种处理业务请求的方法、装置和存储介质以及电子设备,该方法包括:向后台服务器发送Ajax业务请求消息;在所述后台服务器根据所述Ajax业务请求消息确定不存在所述客户端的会话时,接收所述后台服务器发送的请求失败消息,并根据所述请求失败消息向所述后台服务器发送Ajax单点登录请求消息,以便所述后台服务器在根据所述Ajax单点登录请求消息确定不存在所述客户端的会话时,向单点登录服务器发送认证请求消息,以使得所述单点登录服务器根据所述认证请求消息进行登录认证;在所述登录认证未通过时,接收所述单点登录服务器发送的认证失败消息,并将当前页面重定向至所述单点登录服务器的登录页面。

Figure 201810731981

The present disclosure relates to a method, an apparatus, a storage medium, and an electronic device for processing a service request. The method includes: sending an Ajax service request message to a background server; and determining that the client does not exist in the background server according to the Ajax service request message. During the session of the terminal, receive the request failure message sent by the background server, and send an Ajax single sign-on request message to the background server according to the request failure message, so that the background server can use the Ajax single sign-on request message according to the request message When it is determined that the session of the client does not exist, send an authentication request message to the single sign-on server, so that the single sign-on server performs login authentication according to the authentication request message; when the login authentication fails, receive the The authentication failure message sent by the single sign-on server, and the current page is redirected to the login page of the single sign-on server.

Figure 201810731981

Description

Method, device and storage medium for processing service request and electronic equipment
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method, an apparatus, a storage medium, and an electronic device for processing a service request.
Background
Single sign-on refers to a user having to log on once to access all mutually trusted applications among multiple applications. Existing single sign-on systems include: when a user accesses a trusted service system for the first time through a client, the background server corresponding to the service system finds that the user is not logged in (has no session), the user jumps to the single sign-on server to request login, the user inputs a user name and a password in a login page of the single sign-on server to submit, after login is successful, a ticket value token corresponding to the user is generated in a memory of the single sign-on server according to the user name and the password, the ticket value token is returned to the client, and the ticket value is stored in a cookie of a domain where the single sign-on server is located, so that when the user accesses another application system again, the ticket value token is taken as a self-authentication certificate in the access request, and after the background server corresponding to the other application system receives the access request, the method comprises the steps that a single sign-on server is redirected to carry out authentication according to a bill value ticket, namely the bill value ticket is compared with a bill value ticket stored in the single sign-on server, if the two bill values are the same, the authentication is determined to be passed, if the two bill values are different, the authentication is determined not to be passed, if the authentication is passed, a user can access other application systems under the condition that the user does not need to log in again, and if the authentication is not passed, the current page of a client side is redirected to a login page of the single sign-on server, so that the user can log in.
However, for the Ajax request, because Ajax is a web page development technology for creating an interactive web page application, asynchronous update of web page data can be realized by using the Ajax request, that is, only a certain part of a web page is updated, and the whole web page is not reloaded, so that the Ajax request cannot redirect the web page, and thus, when a background server of a service system determines that a session corresponding to the Ajax request does not exist, the Ajax request cannot redirect from a client to a single sign-on server, and the single sign-on authentication cannot be performed and the process of redirecting the sign-on page when the authentication fails is also failed.
Disclosure of Invention
In order to solve the above problem, the present disclosure provides a method, an apparatus, and a storage medium for processing a service request, and an electronic device.
In a first aspect, the present disclosure provides a method for processing a service request, which is applied to a client, and includes: sending Ajax service request information to a background server; when the background server determines that the session of the client does not exist according to the Ajax service request message, receiving a request failure message sent by the background server, and sending an Ajax single sign-on request message to the background server according to the request failure message, so that the background server sends an authentication request message to the single sign-on server when determining that the session of the client does not exist according to the Ajax single sign-on request message, and the single sign-on server performs login authentication according to the authentication request message; and when the login authentication is not passed, receiving an authentication failure message sent by the single sign-on server, and redirecting the current page to the login page of the single sign-on server.
Optionally, the method further comprises: when the login authentication is passed, receiving an authentication passing message sent by the single sign-on server through the background server; and resending the Ajax service request message according to the authentication passing message.
Optionally, the method further comprises: and when the background server determines that the session of the client exists according to the Ajax single sign-on request message, receiving a confirmation message sent by the background server, and resending the Ajax service request message according to the confirmation message.
In a second aspect, a method for processing a service request is provided, and is applied to a background server corresponding to a client, and includes: receiving an Ajax service request message sent by a client; when determining that the session of the client does not exist according to the Ajax service request message, sending a request failure message to the client; receiving an Ajax single sign-on request message sent by the client according to the request failure message; and when determining that the session of the client does not exist according to the Ajax single sign-on request message, sending an authentication request message to the single sign-on server so that the single sign-on server can carry out sign-on authentication according to the authentication request message, and redirecting the current page of the client to the sign-on page of the single sign-on server when the sign-on authentication is not passed.
Optionally, the method further comprises: and when the login authentication is passed, receiving authentication success information sent by the single sign-on server, generating an authentication object corresponding to the Ajax single sign-on request message according to the authentication success information, adding the authentication object into the session, and sending an authentication passing message to the client so that the client can resend the Ajax service request message according to the authentication passing message.
Optionally, the method further comprises: and when determining that the session of the client exists according to the Ajax single sign-on request message, sending a confirmation message to the client so that the client can resend the Ajax service request message according to the confirmation message.
In a third aspect, an apparatus for processing a service request is provided, and is applied to a client, and includes: the service request sending module is used for sending Ajax service request information to the background server; the single sign-on request sending module is used for receiving a request failure message sent by the background server when the background server determines that the session of the client does not exist according to the Ajax service request message, and sending the Ajax single sign-on request message to the background server according to the request failure message, so that the background server sends an authentication request message to the single sign-on server when determining that the session of the client does not exist according to the Ajax single sign-on request message, and the single sign-on server performs login authentication according to the authentication request message; and the page redirection module is used for receiving an authentication failure message sent by the single sign-on server and redirecting the current page to the login page of the single sign-on server when the login authentication fails.
Optionally, the apparatus further comprises: the authentication passing message receiving module is used for receiving an authentication passing message sent by the single sign-on server through the background server when the sign-on authentication passes; and the service request sending module is also used for resending the Ajax service request message according to the authentication passing message.
Optionally, the apparatus further comprises: and the confirmation message receiving module is used for receiving the confirmation message sent by the background server when the background server determines that the session of the client exists according to the Ajax single sign-on request message, and resending the Ajax service request message according to the confirmation message.
In a fourth aspect, an apparatus for processing a service request is provided, which is applied to a background server, and includes: the service request receiving module is used for receiving the Ajax service request message sent by the client; a failure message sending module, configured to send a request failure message to the client when determining that the session of the client does not exist according to the Ajax service request message; the single sign-on request receiving module is used for receiving the Ajax single sign-on request message sent by the client according to the request failure message; and the authentication request module is used for sending an authentication request message to the single sign-on server when the existence of the session of the client is determined according to the Ajax single sign-on request message, so that the single sign-on server can conveniently carry out login authentication according to the authentication request message, and can redirect the current page of the client to the login page of the single sign-on server when the login authentication is not passed.
Optionally, the apparatus further comprises: and the authentication passing message sending module is used for receiving authentication success information sent by the single sign-on server when the login authentication passes, generating an authentication object corresponding to the Ajax single sign-on request message according to the authentication success information, adding the authentication object into the session, and sending an authentication passing message to the client so that the client can resend the Ajax service request message according to the authentication passing message.
Optionally, the apparatus further comprises: and the confirmation message sending module is used for sending a confirmation message to the client when the existence of the session of the client is determined according to the Ajax single sign-on request message, so that the client can resend the Ajax service request message according to the confirmation message.
In a fifth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect.
In a sixth aspect, an electronic device applied to a client is provided, including: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method of the first aspect.
In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the method of the second aspect.
In an eighth aspect, an electronic device is provided, which is applied to a client and includes: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method of the second aspect.
According to the technical scheme, when the background server of the service system determines that the session of the client does not exist according to the Ajax service request message, the client sends the Ajax single-point login request message to the background server to request the background server to perform single-point login authentication of the Ajax service request, so that single-point login of the Ajax service request is initiated through the sent Ajax single-point login request message, and the problem that the single-point login of the Ajax service request cannot be performed due to the fact that the Ajax service request cannot be redirected from the client to the single-point login server when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a schematic flowchart of a method for processing a service request according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another method for processing a service request according to an embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a third method for processing a service request according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of an apparatus for processing a service request according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of another apparatus for processing a service request according to an embodiment of the present disclosure;
fig. 6 is a schematic hardware structure diagram of an apparatus for processing a service request according to an embodiment of the present disclosure;
fig. 7 is a schematic hardware structure diagram of another apparatus for processing a service request according to an embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
The method comprises the steps that when a background server of a service system determines that a session corresponding to an Ajax service request does not exist, a client sends an Ajax single-point login request message to the background server to request the background server to perform single-point login authentication of the Ajax service request, and thus single-point login of the Ajax service request is initiated through the sent Ajax single-point login request message, and the problem that the Ajax service request cannot be subjected to single-point login due to the fact that the Ajax service request cannot be redirected from the client to the single-point login server when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
The present disclosure is described below with reference to specific examples.
Fig. 1 is a method for processing a service request according to an embodiment of the present disclosure, as shown in fig. 1, the method is applied to a client, and the method includes:
s101, sending the Ajax service request message to a background server.
S102, when the background server determines that the session of the client does not exist according to the Ajax service request message, receiving a request failure message sent by the background server, and sending an Ajax single sign-on request message to the background server according to the request failure message, so that the background server sends an authentication request message to the single sign-on server when determining that the session of the client does not exist according to the Ajax single sign-on request message, and the single sign-on server performs login authentication according to the authentication request message.
Wherein, whether the background server has the session of the client can be determined through the session identification.
It should be noted that, when a client sends a login request to a background server for the first time, the background server generates a corresponding session according to the login request, where the session includes a session identifier and sends the session identifier to the client, and the client stores the session identifier after receiving the session identifier and sends the session identifier to the background server together when sending a service request in the following, so that the background server determines whether a session of the client exists according to the session identifier.
In a possible implementation manner, the background server may compare the session identifier in the Ajax service request message with the stored session identifier, determine that the session of the client exists when the session identifier in the Ajax service request message is the same as the stored session identifier, and determine that the session of the client does not exist when the session identifier in the Ajax service request message is different from the stored session identifier.
After the background server determines that the session of the client does not exist according to the Ajax service request message, the client receives the request failure message sent by the background server, records the Ajax service request message after receiving the request failure message, and sends the Ajax single sign-on request message to the background server, wherein the Ajax single sign-on request message is used for requesting to initiate single sign-on of the Ajax service request.
After receiving the Ajax single sign-on request message sent by the client, the background server determines whether the session of the client exists according to the Ajax single sign-on request message, where determining whether the session of the client exists according to the Ajax single sign-on request message may refer to the process of determining whether the session of the client exists according to the Ajax service request message, and details are not repeated here.
It should be noted that, after the client receives the request failure message, the context information corresponding to the Ajax service request message is lost, so that after the Ajax single sign-on request message is sent to the backend server, the backend server still needs to determine whether the dialog of the client exists according to the Ajax single sign-on request message.
The method comprises the steps that a background server can send an authentication request message to a single sign-on server when determining that a session of a client does not exist according to the Ajax single sign-on request message, the authentication request message comprises a cookie of the client, the single sign-on server obtains a ticket value token corresponding to a client request from the cookie after receiving the authentication request message, compares the ticket value token with a ticket value token stored by the single sign-on server, if the ticket value token corresponding to the client request is the same as the ticket value token stored by the single sign-on server, the login authentication is determined to be passed, and if the ticket value token corresponding to the client request is different from the ticket value token stored by the single sign-on server, the login authentication is determined to be failed.
It should be noted that, when the background server determines that the session of the client exists according to the Ajax single sign-on request message, the background server receives a confirmation message sent by the background server, and resends the Ajax service request message according to the confirmation message.
S103, when the login authentication is not passed, receiving an authentication failure message sent by the single sign-on server, and redirecting the current page to the login page of the single sign-on server.
Here, after the current page is redirected to the login page of the single sign-on server, the user inputs authentication information (user name, password, or the like) through the login page, and logs in again.
And the single sign-on server can be redirected to the login page of the single sign-on server through the failure callback.
And when the login authentication is passed, receiving an authentication passing message sent by the single sign-on server through the background server, and resending the Ajax service request message according to the authentication passing message.
By adopting the method, the single sign-on of the Ajax service request is initiated through the transmitted Ajax single sign-on request message, so that the problem that the Ajax service request cannot be subjected to single sign-on because the Ajax service request cannot be redirected to the single sign-on server from the client when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
Fig. 2 is a method for processing a service request according to another embodiment of the present disclosure, as shown in fig. 2, the method is applied to a backend server, and the method includes:
s201, receiving an Ajax service request message sent by a client.
S202, when determining that the session of the client does not exist according to the Ajax service request message, sending a request failure message to the client.
Wherein, whether the background server has the session of the client can be determined through the session identification.
It should be noted that, when a client sends a login request to a background server for the first time, the background server generates a corresponding session according to the login request, where the session includes a session identifier and sends the session identifier to the client, and the client stores the session identifier after receiving the session identifier and sends the session identifier to the background server together when sending a service request in the following, so that the background server determines whether a session of the client exists according to the session identifier.
In a possible implementation manner, the background server may compare the session identifier in the Ajax service request message with the stored session identifier, determine that the session of the client exists when the session identifier in the Ajax service request message is the same as the stored session identifier, and determine that the session of the client does not exist when the session identifier in the Ajax service request message is different from the stored session identifier.
S203, receiving the Ajax single sign-on request message sent by the client according to the request failure message.
Therefore, the single sign-on of the Ajax service request can be initiated through the Ajax single sign-on request message, and the problem that the Ajax service request cannot be subjected to single sign-on because the Ajax service request cannot be redirected to the single sign-on server from the client when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
S204, when the fact that the session of the client does not exist is determined according to the Ajax single sign-on request message, an authentication request message is sent to the single sign-on server, so that the single sign-on server can conveniently conduct sign-on authentication according to the authentication request message, and when the sign-on authentication fails, the current page of the client is redirected to the sign-on page of the single sign-on server.
In this step, the background server may send an authentication request message to the single sign-on server when determining that there is no session of the client according to the Ajax single sign-on request message, where the authentication request message includes a cookie of the client, and after receiving the authentication request message, the single sign-on server obtains a ticket value ticket corresponding to the client request from the cookie, compares the ticket value ticket with a ticket value ticket stored by the single sign-on server itself, determines that the login authentication is passed if the ticket value ticket corresponding to the client request is the same as the ticket value ticket stored by the single sign-on server itself, and determines that the login authentication is not passed if the ticket value ticket corresponding to the client request is the same as the ticket value ticket stored by the single sign-on server itself.
It should be noted that, when determining that the session of the client exists according to the Ajax single sign-on request message, sending a confirmation message to the client, so that the client resends the Ajax service request message according to the confirmation message.
In addition, when the login authentication is passed, the authentication success information sent by the single sign-on server is received, the authentication object corresponding to the Ajax single sign-on request message is generated according to the authentication success information, the authentication object is added into the session, and the authentication passing message is sent to the client, so that the client can resend the Ajax service request message according to the authentication passing message.
By adopting the method, the single sign-on of the Ajax service request is initiated through the transmitted Ajax single sign-on request message, so that the problem that the Ajax service request cannot be subjected to single sign-on because the Ajax service request cannot be redirected to the single sign-on server from the client when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
Fig. 3 is a method for processing a service request according to another embodiment of the present disclosure, as shown in fig. 3, the method includes:
s301, the client sends the Ajax service request message to the background server.
Wherein the client may be a browser.
S302, the background server determines whether a session of the client exists according to the Ajax service request message.
When it is determined that there is no session for the client, performing step S303 to step S305;
and when the session of the client side is determined to exist, accessing a service system according to the Ajax service request message.
S303, the background server sends a request failure message to the client and performs failure callback processing.
Wherein the request failure message may be a 500 exception message.
S304, the client records the Ajax service request message and sends the Ajax single sign-on request message to the background server according to the request failure message.
The Ajax single sign-on request message may include a current URL (Uniform Resource Location) of the client and a cookie of the client.
S305, the background server determines whether the session of the client exists according to the Ajax single sign-on request message.
When it is determined that there is no session for the client, performing step S306 to step S310;
upon determining that there is a session for the client, step S312 is performed.
S306, the background server sends an authentication request message to the single sign-on server.
The background server may send an authentication request message to the single sign-on server with the current URL as a parameter.
And S307, the single sign-on server performs login authentication according to the authentication request message.
In this step, the authentication request message further includes a cookie of the client, after receiving the authentication request message, the single sign-on server obtains a ticket value ticket corresponding to the client request from the cookie, compares the ticket value ticket with a ticket value ticket stored in the single sign-on server itself, determines that the login authentication is passed if the ticket value ticket corresponding to the client request is the same as the ticket value ticket stored in the single sign-on server itself, and determines that the login authentication is not passed if the ticket value ticket corresponding to the client request is the same as the ticket value ticket stored in the single sign-on server itself.
And S308, when the login authentication is passed, the single sign-on server sends an authentication success message to the background server.
In this step, the single sign-on server sends an authentication success message to the background server according to the current URL.
S309, the client initializes the conversation according to the authentication success message and sends an authentication passing message to the client.
In this step, an authentication object corresponding to the Ajax single sign-on request message may be generated according to the authentication success information, and the authentication object is added to the session, so as to complete initialization of the session, and generate a session corresponding to the Ajax single sign-on request message.
And S310, the client performs successful callback processing according to the authentication passing message, and sends the recorded Ajax service request message to the background server again, and returns to the step S302.
In this step, the client may send the recorded Ajax service request message to the background server again in the successful callback processing.
S311, when the login authentication is not passed, the single sign-on server sends an authentication failure message to the client.
Wherein the authentication failure message may be a 500 exception message.
S312, the client redirects the current page to the login page of the single sign-on server according to the authentication failure message.
In this step, the client performs failure callback processing according to the authentication failure message, and redirects the current page of the client to the login page of the single sign-on server through window.
Note that the dotted arrows in fig. 3 indicate steps executed when the login authentication fails.
S313, the background server sends a confirmation message to the client.
And S314, the client performs successful callback processing according to the confirmation message and retransmits the Ajax service request message.
In this step, the client may send the recorded Ajax service request message to the background server again in the successful callback processing.
By adopting the method, the single sign-on of the Ajax service request is initiated through the transmitted Ajax single sign-on request message, so that the problem that the Ajax service request cannot be subjected to single sign-on because the Ajax service request cannot be redirected to the single sign-on server from the client when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
Fig. 4 is a device for processing a service request according to an embodiment of the present disclosure, and as shown in fig. 4, the device is applied to a client, and includes:
a service request sending module 401, configured to send an Ajax service request message to a background server;
a single sign-on request sending module 402, configured to receive a request failure message sent by the background server when the background server determines that the session of the client does not exist according to the Ajax service request message, and send an Ajax single sign-on request message to the background server according to the request failure message, so that the background server sends an authentication request message to the single sign-on server when determining that the session of the client does not exist according to the Ajax single sign-on request message, so that the single sign-on server performs login authentication according to the authentication request message;
the page redirection module 403 is configured to receive an authentication failure message sent by the single sign-on server when the login authentication fails, and redirect the current page to the login page of the single sign-on server.
Optionally, the apparatus further comprises:
the authentication passing message receiving module is used for receiving an authentication passing message sent by the single sign-on server through the background server when the sign-on authentication passes;
the service request sending module 401 is configured to resend the Ajax service request message according to the authentication pass message.
Optionally, the apparatus further comprises:
and the confirmation message receiving module is used for receiving the confirmation message sent by the background server when the background server determines that the session of the client exists according to the Ajax single sign-on request message, and resending the Ajax service request message according to the confirmation message.
By adopting the method, the single sign-on of the Ajax service request is initiated through the transmitted Ajax single sign-on request message, so that the problem that the Ajax service request cannot be subjected to single sign-on because the Ajax service request cannot be redirected to the single sign-on server from the client when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
Fig. 5 is a device for processing a service request according to an embodiment of the present disclosure, and as shown in fig. 5, the device is applied to a client, and includes:
a service request receiving module 501, configured to receive an Ajax service request message sent by a client;
a failure message sending module 502, configured to send a request failure message to the client when it is determined that the session of the client does not exist according to the Ajax service request message;
a single sign-on request receiving module 503, configured to receive an Ajax single sign-on request message sent by the client according to the request failure message;
an authentication request module 504, configured to send an authentication request message to the single sign-on server when it is determined that the session of the client does not exist according to the Ajax single sign-on request message, so that the single sign-on server performs login authentication according to the authentication request message, and redirects a current page of the client to a login page of the single sign-on server when the login authentication fails.
Optionally, the apparatus further comprises:
and the authentication passing message sending module is used for receiving authentication success information sent by the single sign-on server when the login authentication passes, generating an authentication object corresponding to the Ajax single sign-on request message according to the authentication success information, adding the authentication object into the session, and sending an authentication passing message to the client so that the client can resend the Ajax service request message according to the authentication passing message.
Optionally, the apparatus further comprises:
and the confirmation message sending module is used for sending a confirmation message to the client when the existence of the session of the client is determined according to the Ajax single sign-on request message, so that the client can resend the Ajax service request message according to the confirmation message.
By adopting the device, the single sign-on of the Ajax service request is initiated through the sent Ajax single sign-on request message, so that the problem that the Ajax service request cannot be subjected to single sign-on because the Ajax service request cannot be redirected to the single sign-on server from the client when the background server determines that the session of the client does not exist according to the Ajax service request message is solved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 6 is a block diagram illustrating an electronic device 600 according to an example embodiment. As shown in fig. 6, the electronic device 600 may be applied to a client, and the electronic device 600 may include: a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input/output (I/O) interface 604, and a communications component 605.
The processor 601 is configured to control the overall operation of the electronic device 600, so as to complete all or part of the steps in the method for processing the service request. The memory 602 is used to store various types of data to support operation at the electronic device 600, such as instructions for any application or method operating on the electronic device 600 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 602 may be implemented by any type of volatile or non-volatile Memory device or 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 multimedia components 603 may include a screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 602 or transmitted through the communication component 605. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 604 provides an interface between the processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding Communication component 605 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described method for Processing service requests.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described method of processing a service request is also provided. For example, the computer readable storage medium may be the memory 602 described above comprising program instructions executable by the processor 601 of the electronic device 600 to perform the method described above for processing service requests.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. For example, electronic device 1900 may be provided as a backend server. Referring to fig. 7, an electronic device 700 includes a processor 722, which may be one or more in number, and a memory 732 for storing computer programs that are executable by the processor 722. The computer programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processor 722 may be configured to execute the computer program to perform the above-described method of processing a service request.
Additionally, electronic device 700 may also include a power component 726 that may be configured to perform power management for electronic device 1900 and a communication component 750 that may be configured to enable communication, e.g., wired or wireless communication, for electronic device 700. The electronic device 700 may also include input/output (I/O) interfaces 758. The electronic device 700 may operate based on an operating system stored in memory 732, such as Windows Server, Mac OS XTM, UnixTM, Linux, and the like.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described method of processing a service request is also provided. For example, the computer readable storage medium may be the memory 732 described above including program instructions that are executable by the processor 722 of the electronic device 700 to perform the method described above for processing service requests.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure. It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (12)

1.一种处理业务请求的方法,其特征在于,应用于客户端,包括:1. a method for processing a service request, characterized in that, applied to a client, comprising: 向后台服务器发送Ajax业务请求消息;Send an Ajax service request message to the background server; 在所述后台服务器根据所述Ajax业务请求消息确定不存在所述客户端的会话时,接收所述后台服务器发送的请求失败消息,并根据所述请求失败消息向所述后台服务器发送Ajax单点登录请求消息,以便所述后台服务器在根据所述Ajax单点登录请求消息确定不存在所述客户端的会话时,向单点登录服务器发送认证请求消息,以使得所述单点登录服务器根据所述认证请求消息进行登录认证;When the background server determines that there is no session of the client according to the Ajax service request message, receive a request failure message sent by the background server, and send Ajax single sign-on to the background server according to the request failure message request message, so that when the background server determines that there is no session of the client according to the Ajax single sign-on request message, it sends an authentication request message to the single sign-on server, so that the single sign-on server can send an authentication request message to the single sign-on server according to the authentication Request message for login authentication; 在所述登录认证未通过时,接收所述单点登录服务器发送的认证失败消息,并将当前页面重定向至所述单点登录服务器的登录页面。When the login authentication fails, the authentication failure message sent by the single sign-on server is received, and the current page is redirected to the login page of the single sign-on server. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises: 在所述登录认证通过时,接收所述单点登录服务器通过所述后台服务器发送的认证通过消息;When the login authentication is passed, receive an authentication pass message sent by the single sign-on server through the background server; 根据所述认证通过消息重新发送所述Ajax业务请求消息。The Ajax service request message is resent according to the authentication pass message. 3.根据权利要求1或2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1 or 2, wherein the method further comprises: 在所述后台服务器根据所述Ajax单点登录请求消息确定存在所述客户端的会话时,接收所述后台服务器发送的确认消息,并根据所述确认消息重新发送所述Ajax业务请求消息。When the background server determines that there is a session of the client according to the Ajax single sign-on request message, the background server receives a confirmation message sent by the background server, and resends the Ajax service request message according to the confirmation message. 4.一种处理业务请求的方法,其特征在于,应用于客户端对应的后台服务器,包括:4. A method for processing a service request, characterized in that, applied to a background server corresponding to a client, comprising: 接收客户端发送的Ajax业务请求消息;Receive the Ajax service request message sent by the client; 在根据所述Ajax业务请求消息确定不存在所述客户端的会话时,向所述客户端发送请求失败消息;When it is determined according to the Ajax service request message that the session of the client does not exist, sending a request failure message to the client; 接收所述客户端根据所述请求失败消息发送的Ajax单点登录请求消息;receiving an Ajax single sign-on request message sent by the client according to the request failure message; 在根据所述Ajax单点登录请求消息确定不存在所述客户端的会话时,向所述单点登录服务器发送认证请求消息,以便所述单点登录服务器根据所述认证请求信息进行登录认证,并在所述登录认证未通过时,将所述客户端的当前页面重定向至所述单点登录服务器的登录页面。When it is determined according to the Ajax single sign-on request message that there is no session of the client, an authentication request message is sent to the single sign-on server, so that the single sign-on server performs login authentication according to the authentication request information, and When the login authentication fails, the current page of the client is redirected to the login page of the single sign-on server. 5.根据权利要求4所述的方法,其特征在于,所述方法还包括:5. The method according to claim 4, wherein the method further comprises: 在所述登录认证通过时,接收所述单点登录服务器发送的认证成功信息,并根据所述认证成功信息生成所述Ajax单点登录请求消息对应的认证对象,并将所述认证对象添加至所述会话中,并向所述客户端发送认证通过消息,以便所述客户端根据所述认证通过消息重新发送所述Ajax业务请求消息。When the login authentication is passed, the authentication success information sent by the single sign-on server is received, and the authentication object corresponding to the Ajax single sign-on request message is generated according to the authentication success information, and the authentication object is added to the In the session, an authentication pass message is sent to the client, so that the client resends the Ajax service request message according to the authentication pass message. 6.根据权利要求4或5所述的方法,其特征在于,所述方法还包括:6. The method according to claim 4 or 5, wherein the method further comprises: 在根据所述Ajax单点登录请求消息确定存在所述客户端的会话时,向所述客户端发送确认消息,以便所述客户端根据所述确认消息重新发送所述Ajax业务请求消息。When it is determined according to the Ajax single sign-on request message that there is a session of the client, a confirmation message is sent to the client, so that the client resends the Ajax service request message according to the confirmation message. 7.一种处理业务请求的装置,其特征在于,应用于客户端,包括:7. A device for processing a service request, characterized in that, applied to a client, comprising: 业务请求发送模块,用于向后台服务器发送Ajax业务请求消息;The service request sending module is used to send the Ajax service request message to the background server; 单点登录请求发送模块,用于在所述后台服务器根据所述Ajax业务请求消息确定不存在所述客户端的会话时,接收所述后台服务器发送的请求失败消息,并根据所述请求失败消息向所述后台服务器发送Ajax单点登录请求消息,以便所述后台服务器在根据所述Ajax单点登录请求消息确定不存在所述客户端的会话时,向单点登录服务器发送认证请求消息,以使得所述单点登录服务器根据所述认证请求消息进行登录认证;The single sign-on request sending module is configured to receive the request failure message sent by the background server when the background server determines that there is no session of the client according to the Ajax service request message, and send the request to the client according to the request failure message. The background server sends an Ajax single sign-on request message, so that when the background server determines that there is no session of the client according to the Ajax single sign-on request message, it sends an authentication request message to the single sign-on server, so that all The single sign-on server performs login authentication according to the authentication request message; 页面重定向模块,用于在所述登录认证未通过时,接收所述单点登录服务器发送的认证失败消息,并将当前页面重定向至所述单点登录服务器的登录页面。A page redirection module, configured to receive an authentication failure message sent by the single sign-on server when the login authentication fails, and redirect the current page to the login page of the single sign-on server. 8.一种处理业务请求的装置,其特征在于,应用于后台服务器,包括:8. A device for processing service requests, characterized in that, applied to a background server, comprising: 业务请求接收模块,用于接收客户端发送的Ajax业务请求消息;The service request receiving module is used to receive the Ajax service request message sent by the client; 失败消息发送模块,用于在根据所述Ajax业务请求消息确定不存在所述客户端的会话时,向所述客户端发送请求失败消息;A failure message sending module, configured to send a request failure message to the client when it is determined according to the Ajax service request message that there is no session of the client; 单点登录请求接收模块,用于接收所述客户端根据所述请求失败消息发送的Ajax单点登录请求消息;a single sign-on request receiving module, configured to receive the Ajax single sign-on request message sent by the client according to the request failure message; 认证请求模块,用于在根据所述Ajax单点登录请求消息确定不存在所述客户端的会话时,向所述单点登录服务器发送认证请求消息,以便所述单点登录服务器根据所述认证请求信息进行登录认证,并在所述登录认证未通过时,将所述客户端的当前页面重定向至所述单点登录服务器的登录页面。An authentication request module, configured to send an authentication request message to the single sign-on server when it is determined according to the Ajax single sign-on request message that the session of the client does not exist, so that the single sign-on server can perform the authentication request according to the information to perform login authentication, and when the login authentication fails, redirect the current page of the client to the login page of the single sign-on server. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1至3任一项所述方法的步骤。9. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented. 10.一种电子设备,其特征在于,应用于客户端,包括:10. An electronic device, characterized in that, applied to a client, comprising: 存储器,其上存储有计算机程序;a memory on which a computer program is stored; 处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求1至3任一项所述方法的步骤。A processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1 to 3. 11.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求4至6任一项所述方法的步骤。11. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the method according to any one of claims 4 to 6 are implemented. 12.一种电子设备,其特征在于,应用于后台服务器,包括:12. An electronic device, characterized in that, applied to a background server, comprising: 存储器,其上存储有计算机程序;a memory on which a computer program is stored; 处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求4至6任一项所述方法的步骤。A processor for executing the computer program in the memory to implement the steps of the method of any one of claims 4 to 6.
CN201810731981.5A 2018-07-05 2018-07-05 Method, device and storage medium for processing service request and electronic equipment Active CN109218389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810731981.5A CN109218389B (en) 2018-07-05 2018-07-05 Method, device and storage medium for processing service request and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810731981.5A CN109218389B (en) 2018-07-05 2018-07-05 Method, device and storage medium for processing service request and electronic equipment

Publications (2)

Publication Number Publication Date
CN109218389A CN109218389A (en) 2019-01-15
CN109218389B true CN109218389B (en) 2021-08-27

Family

ID=64990225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810731981.5A Active CN109218389B (en) 2018-07-05 2018-07-05 Method, device and storage medium for processing service request and electronic equipment

Country Status (1)

Country Link
CN (1) CN109218389B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112214699B (en) * 2019-07-10 2023-11-07 腾讯科技(深圳)有限公司 Page processing method and related device
CN110995703B (en) * 2019-12-03 2021-09-17 望海康信(北京)科技股份公司 Service processing request processing method and device, and electronic device
CN113918905A (en) * 2019-12-24 2022-01-11 支付宝(杭州)信息技术有限公司 Service processing method and device and electronic equipment
CN111371811B (en) * 2020-04-23 2022-08-09 Oppo广东移动通信有限公司 Resource calling method, resource calling device, client and service server
CN112689017B (en) * 2020-12-28 2023-04-18 咪咕文化科技有限公司 Redirection processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404349A (en) * 2011-12-31 2012-04-04 山东中创软件工程股份有限公司 Single sign-on method
CN102624918A (en) * 2012-03-30 2012-08-01 北京英富森信息技术有限公司 Proxy access method based on URL (Uniform Resource Locator) rewriting technique
CN104426862A (en) * 2013-08-27 2015-03-18 腾讯科技(深圳)有限公司 Method, system, and browser realizing cross-domain request login
CN104519050A (en) * 2014-11-14 2015-04-15 百度在线网络技术(北京)有限公司 Login method and login system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8763104B2 (en) * 2009-08-27 2014-06-24 International Business Machines Corporation Establishing and maintaining an improved Single Sign-on (SSO) facility
US8745718B1 (en) * 2012-08-20 2014-06-03 Jericho Systems Corporation Delivery of authentication information to a RESTful service using token validation scheme

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102404349A (en) * 2011-12-31 2012-04-04 山东中创软件工程股份有限公司 Single sign-on method
CN102624918A (en) * 2012-03-30 2012-08-01 北京英富森信息技术有限公司 Proxy access method based on URL (Uniform Resource Locator) rewriting technique
CN104426862A (en) * 2013-08-27 2015-03-18 腾讯科技(深圳)有限公司 Method, system, and browser realizing cross-domain request login
CN104519050A (en) * 2014-11-14 2015-04-15 百度在线网络技术(北京)有限公司 Login method and login system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于AJAX和SAML技术的互联网单点登录系统";唐四薪等;《计算机系统应用》;20080630;第108-111页 *

Also Published As

Publication number Publication date
CN109218389A (en) 2019-01-15

Similar Documents

Publication Publication Date Title
CN109218389B (en) Method, device and storage medium for processing service request and electronic equipment
KR102511811B1 (en) Techniques for securely authenticating bot users
US10085150B2 (en) Authenticating mobile applications using policy files
US10375073B2 (en) Configuration based client for OAuth authorization with arbitrary services and applications
US8869258B2 (en) Facilitating token request troubleshooting
WO2019218747A1 (en) Third party authorized login method and system
CN109815684B (en) An identity authentication method, system, server and storage medium
US9544311B2 (en) Secure identity propagation in a cloud-based computing environment
US20200153814A1 (en) Method for authentication with identity providers
CN106331003B (en) A method and device for accessing an application portal system on a cloud desktop
CN109787989B (en) A password modification method, system, target server and storage medium
CN111355726A (en) Identity authorization login method and device, electronic equipment and storage medium
US20180167380A1 (en) Providing a secure communication path for receiving a software update
WO2021252225A1 (en) Method and system for authentication data passing
US20230014970A1 (en) Remapping of uniform resource locators for accessing network applications
CN109391600B (en) Distributed denial of service attack protection method, device, system, medium and equipment
US10069814B2 (en) Single sign on across multiple devices using a unique machine identification
JP2022519221A (en) Methods, systems, and devices for improved multi-factor authentication in multi-app communication systems
EP3232695B1 (en) Provisioning enterprise services
US20220182388A1 (en) Transfer of trust between authentication devices
CN112968892A (en) Information verification method, device, computing equipment and medium
CN106161356B (en) Method and system for rapidly logging in website through client
EP3337125A1 (en) Authenticating for an enterprise service
US20190319946A1 (en) Universal group support for authentication systems
US20220377064A1 (en) Method and system for managing a web security protocol

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
TR01 Transfer of patent right

Effective date of registration: 20250224

Address after: Room E162, Room 301 to 353, No.1 Kehua Street, Tianhe District, Guangzhou City, Guangdong Province, 510640 (Office only)

Patentee after: Guangzhou binju Technology Co.,Ltd.

Country or region after: China

Address before: Hunnan rookie street Shenyang city Liaoning province 110179 No. 2

Patentee before: NEUSOFT Corp.

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20250305

Address after: Room 204, Building B, Liantou Holdings Building, No. 123 Fenghui North Road, Lianhu District, Xi'an City, Shaanxi Province 710000

Patentee after: Xi'an Gewu Medical Technology Co.,Ltd.

Country or region after: China

Address before: Room E162, Room 301 to 353, No.1 Kehua Street, Tianhe District, Guangzhou City, Guangdong Province, 510640 (Office only)

Patentee before: Guangzhou binju Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right
OSZAR »