[go: up one dir, main page]

WO2019095567A1 - 单点登录的校验装置、方法及计算机可读存储介质 - Google Patents

单点登录的校验装置、方法及计算机可读存储介质 Download PDF

Info

Publication number
WO2019095567A1
WO2019095567A1 PCT/CN2018/076107 CN2018076107W WO2019095567A1 WO 2019095567 A1 WO2019095567 A1 WO 2019095567A1 CN 2018076107 W CN2018076107 W CN 2018076107W WO 2019095567 A1 WO2019095567 A1 WO 2019095567A1
Authority
WO
WIPO (PCT)
Prior art keywords
login request
token information
user data
single sign
time
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.)
Ceased
Application number
PCT/CN2018/076107
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2019095567A1 publication Critical patent/WO2019095567A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

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/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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a verification apparatus, method, and computer readable storage medium for single sign-on.
  • the solution for verifying is generally: when the user terminal first logs in to an application system, the server generates a unique token information (token), and the token information and the login information.
  • the account establishes a mapping relationship, and the token information is sent to the user terminal, so that when the user terminal logs in to another application system to log in, the token information is carried and verified, and the account, password, and the like are no longer input, so that the user only You need to log in once to access all trusted applications.
  • a database needs to be established on the server side, and the account information of a large number of users and the token information assigned thereto and the mapping relationship between them need to be maintained.
  • the query needs to be performed.
  • the correspondence between the token information and the user in the database can query the user information and verify the login authority of the user.
  • the scheme not only needs to maintain a large amount of data on the server side, but also needs to be verified every time. Querying the mapping relationship from the database results in low verification efficiency.
  • the present application provides a verification apparatus, method, and computer readable storage medium for single sign-on, the main purpose of which is to reduce the amount of data maintained by the server and improve the verification efficiency of single sign-on.
  • the present application provides a verification apparatus for single sign-on, the apparatus comprising a memory and a processor, wherein the memory stores a verification program for single sign-on that can be run on the processor,
  • the verification procedure for single sign-on is implemented by the processor to implement the following steps:
  • the login request includes the token information, the token information and the user data are obtained from the login request, and the time when the login request is received is recorded;
  • Decrypting the token information by using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain user data and a credential creation time included in the token information;
  • the present application further provides a verification method for single sign-on, which includes:
  • the user data is obtained from the login request, where the user data includes at least user identity information and a service system identifier;
  • the current time is used as the voucher creation time, and the pre-stored key is obtained;
  • the present application further provides a computer readable storage medium, where the verification program of single sign-on is stored, and the verification program of the single sign-on can be one or Multiple processors execute to implement the following steps:
  • the login request includes the token information, the token information and the user data are obtained from the login request, and the time when the login request is received is recorded;
  • Decrypting the token information by using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain user data and a credential creation time included in the token information;
  • the verification device, the method, and the computer readable storage medium of the single sign-on provided by the present application when the logger request sent by the user terminal carries the token information, obtains the user data and the token information from the login request, and records and receives the At the time of the login request, the token information is decrypted using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain the user data and the credential creation time contained therein, and the user data included in the login request is The user included in the token information is compared, and it is determined whether the time difference between the recorded time and the acquired time of creating the credential is less than a preset threshold.
  • the token information for verifying the rights carried in the login request includes the encrypted user data, and a voucher generation time. After decrypting the token information, the token information can be obtained. User data and credential generation time, and thus included in the login request The user data is compared to verify the validity of the token information.
  • the scheme does not need to maintain the mapping relationship between the token information and the user data on the server side, and does not need to search for the corresponding user information according to the mapping relationship every time the verification is performed. , thereby reducing the amount of data that needs to be maintained, and improving the efficiency of single sign-on verification.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a verification device for single sign-on in the present application
  • FIG. 2 is a schematic diagram of a program module of a verification procedure for single sign-on in an embodiment of the verification apparatus for single sign-on in the present application;
  • FIG. 3 is a flow chart of a preferred embodiment of a verification method for single sign-on in the present application.
  • the application provides a verification device for single sign-on.
  • a schematic diagram of a preferred embodiment of a verification apparatus for single sign-on is provided.
  • the single sign-on verification device includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may in some embodiments be an internal storage unit of a single sign-on verification device, such as the hard disk of the single sign-on verification device.
  • the memory 11 may also be an external storage device of the single sign-on verification device in other embodiments, such as a plug-in hard disk equipped with a single sign-on verification device, a smart memory card (SMC), Secure Digital (SD) card, Flash Card, etc.
  • SMC smart memory card
  • SD Secure Digital
  • the memory 11 may also include an internal storage unit of the single sign-on verification device and an external storage device.
  • the memory 11 can be used not only for storing application software installed in the verification device of the single sign-on and various types of data, such as code of a check-out program for single sign-on, but also for temporarily storing data that has been output or will be output. .
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as a verification program that performs single sign-on, and the like.
  • Communication bus 13 is used to implement connection communication between these components.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Figure 1 shows only the verification device for single sign-on with components 11-14 and the checkout procedure for single sign-on, but it should be understood that not all of the illustrated components are required to be implemented, and alternative implementations are possible. Or fewer components.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display may also be appropriately referred to as a display screen or display unit for displaying information processed in the verification device of the single sign-on and a user interface for displaying the visualization.
  • a verification program for single sign-on is stored in the memory 11; when the processor 12 executes the verification program for the single sign-on stored in the memory 11, the following steps are implemented:
  • the login request includes the token information
  • the token information and the user data are obtained from the login request, and the time when the login request is received is recorded.
  • the verification device for single sign-on proposed in this embodiment may be a single sign-on server.
  • the login request received by the verification device may be directly sent by the user terminal, or may be redirected by the service system to the verification device after the user terminal sends the information to the service system.
  • the verification device detects whether there is token information in the login request. If the token information is included, it indicates that the current login of the user terminal is not the first login, and the token information is allocated by the verification device when the login is previously registered.
  • the manner in which the verification device allocates the token information to the user terminal is: when the user terminal first logs in to the service system, or when it detects that the token carried in the login request fails, the user terminal is assigned a token.
  • the user data is obtained from the login request, where the user data includes at least user identity information and a service system identifier; Time as a voucher creation time, and acquiring a pre-stored key; encrypting the user data and the voucher creation time based on the key and the first preset encryption algorithm; acquiring a string obtained by the encryption process, The character string is used as token information, and the token information is sent to the user terminal.
  • the foregoing user data may include, but is not limited to, the following data: user identity information, a service system identifier, a user IP address, a single sign-on server group, an IP address of a host where the agent is located, and the like.
  • the above information is obtained from the login request, and the above information is combined, wherein the information is distinguished by "
  • the credential creation time is the current time, that is, The time when the encryption process.
  • the user data and the credential creation time may be separately encrypted, and then the combined result is further encrypted.
  • the step of performing encryption processing on the user data and the credential creation time based on the key and the first preset encryption algorithm includes:
  • the first encryption result and the second encryption result are combined into one character string; and the character string is encrypted according to the second preset encryption algorithm.
  • the first preset encryption algorithm may be an AES algorithm
  • the second preset encryption algorithm may be a BASE64 algorithm. In other embodiments, other encryption algorithms may be selected according to requirements.
  • the key used in the above process may be stored by the verification device after acquiring the key from other channels, or the verification device may generate the key according to the following steps:
  • SEED encryption processing, wherein the third preset encryption algorithm may be the HMAC_SHA_1 algorithm.
  • the specific process of generating a key is as follows:
  • PK(V) HOTP(SEED,V)
  • HOTP(K,C) (HMAC_SHA_1(K',C')&0x7FFFFFFF)mod 10d, where K' is the hash data of K, C' is the hash data of C, and SEED and V are taken as K and C respectively. The values are taken into the above formula to calculate HOTP (SEED, V) and HOTP (SEED, V + 1).
  • HMAC_SHA_1 algorithm for HASH hashing a 20-byte 40-bit hexadecimal number is obtained, mod is the remainder operation, and a 10th-order square-module operation is used to obtain a digital password of the d-bit.
  • HOTP is a one-time password algorithm based on HMAC.
  • the HMAC (Hash Message Authentication Code) algorithm mainly uses a hash algorithm to generate a message digest with a key and a message as input. Output, which can be bundled with any iterative hash function, such as the SHAS (Secure Hash Algorithm) algorithm to form the HMAC_SHA_1 algorithm.
  • SHAS Secure Hash Algorithm
  • the verification device sends the result of the encryption process as the token information to the user terminal for storage, and the user terminal carries the token information in the subsequent login request, for example, to the service system.
  • the token information is carried, so that all the trusted application systems can be accessed only by one login.
  • the login request includes the token information
  • the token information and the user data included in the request are obtained, and the time when the login request is received is recorded, and the legality of the obtained token information is verified.
  • the token information is decrypted using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain user data and credential creation time included in the token information.
  • the token information is decrypted, and the decryption process is essentially an inverse operation on the encryption process, and is decrypted according to the first preset encryption algorithm and a pre-stored key.
  • the preset threshold is a validity period of a token information set at the verification device. When the threshold is exceeded, the token information is considered to be invalid, and the user terminal is required to re-authenticate and re-acquire new token information.
  • the registrar request sent by the user terminal carries the token information
  • the user equipment and the token information are acquired from the login request, and the time when the login request is received is recorded and used.
  • the decryption algorithm corresponding to the first preset encryption algorithm and the pre-stored key decrypt the token information to obtain the user data and the credential creation time contained therein, and perform the user data included in the login request and the user included in the token information.
  • the token information used for the verification permission carried in the login request includes the encrypted user data, and a voucher generation time. After the token information is decrypted and processed, the user data and the voucher generation can be obtained. Time, which is compared with the user data contained in the login request. For the verification of the validity of the token information, the scheme does not need to maintain the mapping relationship between the token information and the user data on the server side, and does not need to search for the corresponding user information according to the mapping relationship each time the verification is performed, thereby reducing the need for maintenance. The amount of data and the effect of improving the verification efficiency of single sign-on.
  • the single sign-on verification program may also be divided into one or more modules, one or more modules being stored in the memory 11 and being processed by one or more processors ( This embodiment is executed by the processor 12) to complete the application.
  • the module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function, and is used to describe the single sign-on verification program in single sign-on. Verify the execution process in the device.
  • FIG. 2 it is a schematic diagram of a program module of a single sign-on verification program in an embodiment of the verification apparatus for single sign-on of the present application.
  • the verification procedure of the single sign-on can be divided.
  • the acquisition module 20 the decryption module 30, and the verification module 40, by way of example:
  • the determining module 10 is configured to: when receiving the login request sent by the user terminal, determine whether the token information is included in the login request;
  • the obtaining module 20 is configured to: if the login request includes the token information, obtain the token information and the user data from the login request, and record the time when the login request is received;
  • the decryption module 30 is configured to: decrypt the token information by using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain user data and a credential creation time included in the token information;
  • the verification module 40 is configured to: compare the user data included in the login request with the user data included in the token information, and determine whether the time difference between the recorded time and the credential creation time is less than a preset threshold. ;
  • the present application also provides a verification method for single sign-on.
  • FIG. 3 it is a flowchart of a preferred embodiment of the verification method for single sign-on of the present application.
  • the method can be performed by a device that can be implemented by software and/or hardware.
  • the verification method of the single sign-on includes:
  • Step S10 When receiving the login request sent by the user terminal, determining whether the token information is included in the login request.
  • Step S20 If the login request includes token information, the token information and the user data are obtained from the login request, and the time when the login request is received is recorded.
  • the verification method of the single sign-on proposed by the embodiment is described below by the single sign-on server.
  • the login request received by the single sign-on server may be directly sent by the user terminal, or may be redirected by the service system to the single sign-on server after the user terminal sends the service to the service system.
  • the single sign-on server detects whether there is token information in the login request. If the token information is included, the current login of the user terminal is not the first login, and the token information is allocated by the single sign-on server when the login is previously registered. of.
  • the above-mentioned single sign-on server allocates token information to the user terminal by assigning a token to the user terminal when the user terminal first logs in to the service system or when detecting that the token carried in the login request fails.
  • the user data is obtained from the login request, where the user data includes at least user identity information and a service system identifier; Time as a voucher creation time, and acquiring a pre-stored key; encrypting the user data and the voucher creation time based on the key and the first preset encryption algorithm; acquiring a string obtained by the encryption process, The character string is used as token information, and the token information is sent to the user terminal.
  • the foregoing user data may include, but is not limited to, the following data: user identity information, a service system identifier, a user IP address, a single sign-on server group, an IP address of a host where the agent is located, and the like.
  • the above information is obtained from the login request, and the above information is combined, wherein the information is distinguished by "
  • the credential creation time is the current time, that is, The time when the encryption process.
  • the user data and the credential creation time may be separately encrypted, and then the combined result is further encrypted.
  • the step of performing encryption processing on the user data and the credential creation time based on the key and the first preset encryption algorithm includes:
  • the first encryption result and the second encryption result are combined into one character string; and the character string is encrypted according to the second preset encryption algorithm.
  • the first preset encryption algorithm may be an AES algorithm
  • the second preset encryption algorithm may be a BASE64 algorithm. In other embodiments, other encryption algorithms may be selected according to requirements.
  • the key used in the above process can be stored by the single sign-on server after obtaining the key from other channels, or by the single sign-on server, the following steps are used to generate the key:
  • SEED encryption processing, wherein the third preset encryption algorithm may be the HMAC_SHA_1 algorithm.
  • the specific process of generating a key is as follows:
  • PK(V) HOTP(SEED,V)
  • HOTP(K,C) (HMAC_SHA_1(K',C')&0x7FFFFFFF)mod 10d, where K' is the hash data of K, C' is the hash data of C, and SEED and V are taken as K and C respectively. The values are taken into the above formula to calculate HOTP (SEED, V) and HOTP (SEED, V + 1).
  • HMAC_SHA_1 algorithm for HASH hashing a 20-byte 40-bit hexadecimal number is obtained, mod is the remainder operation, and a 10th-order square-module operation is used to obtain a digital password of the d-bit.
  • HOTP is a one-time password algorithm based on HMAC.
  • the HMAC (Hash Message Authentication Code) algorithm mainly uses a hash algorithm to generate a message digest with a key and a message as input. Output, which can be bundled with any iterative hash function, such as the SHAS (Secure Hash Algorithm) algorithm to form the HMAC_SHA_1 algorithm.
  • SHAS Secure Hash Algorithm
  • the single sign-on server sends the result of the encryption process to the user terminal for storage as a token, and the user terminal carries the token information in a subsequent login request, for example, to the service system.
  • the token information is carried, so that all the trusted application systems can be accessed only by one login.
  • the login request includes the token information
  • the token information and the user data included in the request are obtained, and the time when the login request is received is recorded, and the legality of the obtained token information is verified.
  • Step S30 Decrypt the token information by using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain user data and a credential creation time included in the token information.
  • Step S40 Compare the user data included in the login request with the user data included in the token information, and determine whether the time difference between the recorded time and the credential creation time is less than a preset threshold.
  • Step S50 If the user data included in the login request is consistent with the user data included in the token information, and the time difference is less than a preset threshold, it is determined that the verification is passed.
  • Step S60 otherwise, it is determined that the verification has failed.
  • the token information is decrypted, and the decryption process is essentially an inverse operation on the encryption process, and is decrypted according to the first preset encryption algorithm and a pre-stored key.
  • the preset threshold is a validity period of a token information set by the single sign-on server. If the threshold is exceeded, the token information is considered invalid, and the user terminal needs to re-authenticate and re-acquire new token information.
  • the method for verifying the single sign-on is provided in the embodiment, when the querier request sent by the user terminal carries the token information, the user data and the token information are obtained from the login request, and the time when the login request is received is used.
  • the decryption algorithm corresponding to the first preset encryption algorithm and the pre-stored key decrypt the token information to obtain the user data and the credential creation time contained therein, and perform the user data included in the login request and the user included in the token information. In contrast, it is determined whether the time difference between the recorded time and the acquired creation credential time is less than a preset threshold.
  • the token information used for the verification permission carried in the login request includes the encrypted user data, and a voucher generation time. After the token information is decrypted and processed, the user data and the voucher generation can be obtained. Time, which is compared with the user data contained in the login request. For the verification of the validity of the token information, the scheme does not need to maintain the mapping relationship between the token information and the user data on the server side, and does not need to search for the corresponding user information according to the mapping relationship each time the verification is performed, thereby reducing the need for maintenance. The amount of data and the effect of improving the verification efficiency of single sign-on.
  • the embodiment of the present application further provides a computer readable storage medium, where the verification program of single sign-on is stored, and the verification program of the single sign-on can be processed by one or more Executed to implement the following steps:
  • the login request includes the token information, the token information and the user data are obtained from the login request, and the time when the login request is received is recorded;
  • Decrypting the token information by using a decryption algorithm corresponding to the first preset encryption algorithm and a pre-stored key to obtain user data and a credential creation time included in the token information;
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

本申请公开了一种单点登录的校验装置,包括存储器和处理器,存储器上存储有可在处理器上运行的单点登录的校验程序,该程序被处理器执行时实现如下步骤:判断用户终端发送的登录请求中是否包含有token信息;若是,则从登录请求中获取token信息和用户数据,并记录接收到该登录请求的时间;使用密钥对token信息解密,以获取token信息中包含的用户数据和凭证创建时间;若登录请求中包含的用户数据与token信息中包含的用户数据一致、且记录的时间与凭证创建时间之间的时间差小于预设阈值,则判定校验通过;否则,判定校验失败。本申请还提出一种单点登录的校验方法以及一种计算机可读存储介质。本申请减少了需要维护的数据量,并提高了单点登录的校验效率。

Description

单点登录的校验装置、方法及计算机可读存储介质
本申请基于巴黎公约申明享有2017年11月15日递交的申请号为201711131291.8、名称为“单点登录的校验装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种单点登录的校验装置、方法及计算机可读存储介质。
背景技术
现有的单点登录技术中,其实现校验的方案一般是:在用户终端首次登录某应用系统时,服务器会生成一个唯一的令牌信息(token),将该令牌信息与该登录的账户建立映射关系,并将该令牌信息发送给用户终端,以供用户终端后续登录其他应用系统登录时,携带该令牌信息进行校验,可以不再输入账号、密码等信息,实现用户只需要登录一次就可以访问所有相互信任的应用系统。
该方案中,需要在服务器端建立数据库,维护大量的用户的账号信息以及为其分配的令牌信息以及他们之间的映射关系,在接收到包含有令牌信息的登录请求时,需要通过查询数据库中这个令牌信息与用户之间的对应关系,便能查询出用户信息,进而对用户的登录权限进行校验,但是方案不仅需要在服务器端维护大量的数据,而且每次校验都需要从数据库查询映射关系,导致校验效率低。
发明内容
本申请提供一种单点登录的校验装置、方法及计算机可读存储介质,其主要目的在于减少服务器端维护的数据量,并提高单点登录的校验效率。
为实现上述目的,本申请提供一种单点登录的校验装置,该装置包括存 储器和处理器,所述存储器中存储有可在所述处理器上运行的单点登录的校验程序,所述单点登录的校验程序被所述处理器执行时实现如下步骤:
当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;
否则,判定校验失败。
此外,为实现上述目的,本申请还提供一种单点登录的校验方法,该方法包括:
当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
若否,则从所述登录请求中获取用户数据,其中,所述用户数据中至少包含有用户身份信息和业务系统标识;
将当前时间作为凭证创建时间,并获取预先存储的密钥;
基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理;
获取加密处理得到的字符串,将所述字符串作为token信息,并将所述token信息发送至所述用户终端。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有单点登录的校验程序,所述单点登录的校验程序可被一个或者多个处理器执行,以实现如下步骤:
当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;
否则,判定校验失败。
本申请提出的单点登录的校验装置、方法及计算机可读存储介质,当用户终端发送的登录器请求中携带有token信息时,从登录请求中获取用户数据和token信息,并记录接收到该登录请求的时间,使用与第一预设加密算法对应的解密算法以及预先存储的密钥对token信息进行解密处理获取其中包含的用户数据和凭证创建时间,将登录请求中包含的用户数据与token信息中包含的用户进行对比,同时判断记录的时间与获取到的创建凭证时间之间的时间差是否小于预设阈值,若是,则判定该token消息合法,故判定校验通过,否则,判定校验失败,从上述方案可以看出,登录请求中携带的用于校验权限的token信息包含有经过加密处理的用户数据,以及一个凭证生成时间,对该token信息解密处理后,即可获取到其中的用户数据和凭证生成时间,从而与登录请求中包含的用户数据进行对比,以实现对token信息合法性的校验,该方案不需要在服务器端维护token信息与用户数据之间的映射关系,也不需要每次验证都根据映射关系查找对应的用户信息,从而实现减少需要维护的数据量,以及提高单点登录的校验效率的效果。
附图说明
图1为本申请单点登录的校验装置较佳实施例的示意图;
图2为本申请单点登录的校验装置一实施例中单点登录的校验程序的程序模块示意图;
图3为本申请单点登录的校验方法较佳实施例的流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种单点登录的校验装置。参照图1所示,为本申请单点登录的校验装置较佳实施例的示意图。
在本实施例中,该单点登录的校验装置至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是单点登录的校验装置的内部存储单元,例如该单点登录的校验装置的硬盘。存储器11在另一些实施例中也可以是单点登录的校验装置的外部存储设备,例如单点登录的校验装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括单点登录的校验装置的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于单点登录的校验装置的应用软件及各类数据,例如单点登录的校验程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行单点登录的校验程序等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。
图1仅示出了具有组件11-14以及单点登录的校验程序的单点登录的校验装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该装置还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在单点登录的校验装置中处理的信息以及用于显示可视化的用户界面。
在图1所示的装置实施例中,存储器11中存储有单点登录的校验程序;处理器12执行存储器11中存储的单点登录的校验程序时实现如下步骤:
当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息。
若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间。
该实施例提出的单点登录的校验装置可以是单点登录服务器。校验装置接收到的登录请求可以是用户终端直接发送的,也可以是用户终端发送至业务系统后,由业务系统重定向到校验装置的。校验装置检测该登录请求中是否有token信息,若包含有token信息,则说明该用户终端的本次登录不是首次登录,上述token信息是在之前登录时,由校验装置为其分配的。
上述校验装置为用户终端分配token信息的实现方式为:在用户终端首次登录业务系统时,或者当检测到登录请求中携带的token失效时,为用户终端分配token。
具体地,作为一种实施方式,若所述登录请求中没有token信息,则从所述登录请求中获取用户数据,其中,所述用户数据中至少包含有用户身份信息和业务系统标识;将当前时间作为凭证创建时间,并获取预先存储的密钥;基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理;获取加密处理得到的字符串,将所述字符串作为token信息,并将所述token信息发送至所述用户终端。
在一些实施例中,上述用户数据可以包括但不限于以下数据:用户身份信息、业务系统标识、用户IP地址、单点登录服务器分组、代理所在主机的IP地址等信息。从登录请求中获取上述信息,将上述信息组合起来,其中,信息之间利用“|”进行区分。在获取到用户数据后,获取服务器中预先存储 的密钥,并使用该密钥和第一预设加密算法对用户数据和凭证创建时间进行加密处理,其中,凭证创建时间为当前时间,即进行加密处理时的时间。可选地,在一些实施例中,可以将用户数据和凭证创建时间分别加密处理后,再对他们的组合结果再进行一次加密处理。
具体地,基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理的步骤包括:
基于所述密钥和第一预设加密算法对所述用户数据进行加密以生成第一加密结果,基于第二预设加密算法对所述凭证创建时间加密以生成第二加密结果;将所述第一加密结果和所述第二加密结果合成为一个字符串;基于所述第二预设加密算法对所述字符串加密处理。
例如,密钥为PK(V),凭证创建时间为cTime,则按照上述步骤加密处理后得到的结果Entoken=BASE64((AES(PK(V),Detoken)||BASE64(cTime)),其中,Detoken为用户数据。上述第一预设加密算法可以是AES算法,第二预设加密算法可以是BASE64算法,在其他实施例中,可以根据需要选择其他加密算法。
关于上述过程中使用到的密钥,可以由校验装置从其他渠道获取密钥后存储,或者由校验装置按照以下步骤生成密钥:
获取当前时间,根据当前时间以及预设的基准时间生成可变因子;从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
具体地,获取当前时间cTime以及预设的基准时间bTime,计算可变因子V=(cTime-bTime)/bTime,从加密机中获取一个随机字符串SEED,对该可变因子V以及随机字符串SEED加密处理,其中第三预设加密算法可以是HMAC_SHA_1算法。生成密钥的具体过程如下:
PK(V)=HOTP(SEED,V)||HOTP(SEED,V+1),其中,“||”为连接符;
HOTP(K,C)=(HMAC_SHA_1(K’,C’)&0x7FFFFFFF)mod 10d,其中,K’为K的散列数据,C’为C的散列数据,将SEED和V分别作为K、C值带入上述公式计算得到HOTP(SEED,V)和HOTP(SEED,V+1)。采用HMAC_SHA_1算法进行HASH散列,会得到一个20字节40位的十六进制数字,mod为取余运算,与10的d次方模运算得到d位的一个数字口令。其 中,HOTP是一种基于HMAC的一次性口令算法,HMAC(Hash Message Authentication Code,散列消息鉴别码)算法主要是利用哈希算法,以一个密钥和一个消息为输入,生成一个消息摘要作为输出,它可以与任何迭代散列函数捆绑使用,例如与SHA_1(Secure Hash Algorithm,安全哈希散列)算法捆绑使用构成HMAC_SHA_1算法。
按照上述方式生成token信息后,校验装置将加密处理得到的结果作为token信息发送给用户终端进行存储,用户终端在后续发送的登录请求中携带该token信息,例如,向与上述业务系统之间具有信任关系的其他业务系统发送登录请求时,携带该token信息,可以实现只需要登录一次就可以访问所有相互信任的应用系统。
若登录请求中包含有token信息,则获取请求中包含的token信息和用户数据,同时记录收到该登录请求时的时间,接下来对获取到的token信息的合法性进行校验。
使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间。
将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值。
若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过。
否则,判定校验失败。
对token信息进行解密处理,解密的过程实质上是对上述加密过程的一个逆运算,按照第一预设加密算法和预先存储的密钥进行解密。
以Entoken=BASE64[AES(PK(V),Detoken)||BASE64(cTime)]为例,则解密时,按照如下过程:
按照BASE64.decode(BASE64[AES(PK(V),Detoken)||BASE64(cTime))运算,得到AES(PK(V),Detoken)和BASE64(cTime),再经过如下运算得到其中包含的用户数据Detoken和凭证创建时间cTime:
DeToken=BASE64.decode(AES.decode(DeToken’)),其中,DeToken’=AES(PK(V),Detoken);
cTime=BASE64.decode(cTime’),其中,cTime’=BASE64(cTime)。
将从token信息中获取到的用户数据和登录请求中包含的用户数据进行对比,同时判断token信息中包含的凭证创建时间与当前时间之间的时间差与是否小于该预设阈值,若token信息中获取到的用户数据和登录请求中包含的用户数据一致,且时间差小于该预设阈值,则校验通过,允许用户直接登录业务系统,若登录请求中包含的用户数据与token信息中包含的用户数据不一致、及/或时间差大于或等于预设阈值,判定校验失败,向用户终端返回登录界面,以供用户输入账号和密码后重新登录。需要说明的是,上述预设阈值为校验装置处设置的一个token信息的有效期,当超出这个阈值,则认为该token信息失效,需要用户终端重新认证,重新获取新的token信息。
本实施例提出的单点登录的校验装置,当用户终端发送的登录器请求中携带有token信息时,从登录请求中获取用户数据和token信息,并记录接收到该登录请求的时间,使用与第一预设加密算法对应的解密算法以及预先存储的密钥对token信息进行解密处理获取其中包含的用户数据和凭证创建时间,将登录请求中包含的用户数据与token信息中包含的用户进行对比,同时判断记录的时间与获取到的创建凭证时间之间的时间差是否小于预设阈值,若是,则判定该token消息合法,故判定校验通过,否则,判定校验失败,从上述方案可以看出,登录请求中携带的用于校验权限的token信息包含有经过加密处理的用户数据,以及一个凭证生成时间,对该token信息解密处理后,即可获取到其中的用户数据和凭证生成时间,从而与登录请求中包含的用户数据进行对比,以实现对token信息合法性的校验,该方案不需要在服务器端维护token信息与用户数据之间的映射关系,也不需要每次验证都根据映射关系查找对应的用户信息,从而实现减少需要维护的数据量,以及提高单点登录的校验效率的效果。
可选地,在其他的实施例中,单点登录的校验程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述单点登录的校验程序在单点登录的校验装置中的执行过程。
例如,参照图2所示,为本申请单点登录的校验装置一实施例中的单点登录的校验程序的程序模块示意图,该实施例中,单点登录的校验程序可以被分割为判断模块10、获取模块20、解密模块30和校验模块40,示例性地:
判断模块10用于:当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
获取模块20用于:若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
解密模块30用于:使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
校验模块40用于:将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
以及,若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;否则,判定校验失败。
上述判断模块10、获取模块20、解密模块30和校验模块40等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请还提供一种单点登录的校验方法。参照图3所示,为本申请单点登录的校验方法较佳实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,单点登录的校验方法包括:
步骤S10,当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息。
步骤S20,若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间。
以下以单点登录服务器为执行主体对实施例提出的单点登录的校验方法进行说明。单点登录服务器接收到的登录请求可以是用户终端直接发送的,也可以是用户终端发送至业务系统后,由业务系统重定向到单点登录服务器 的。单点登录服务器检测该登录请求中是否有token信息,若包含有token信息,则说明该用户终端的本次登录不是首次登录,上述token信息是在之前登录时,由单点登录服务器为其分配的。
上述单点登录服务器为用户终端分配token信息的实现方式为:在用户终端首次登录业务系统时,或者当检测到登录请求中携带的token失效时,为用户终端分配token。
具体地,作为一种实施方式,若所述登录请求中没有token信息,则从所述登录请求中获取用户数据,其中,所述用户数据中至少包含有用户身份信息和业务系统标识;将当前时间作为凭证创建时间,并获取预先存储的密钥;基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理;获取加密处理得到的字符串,将所述字符串作为token信息,并将所述token信息发送至所述用户终端。
在一些实施例中,上述用户数据可以包括但不限于以下数据:用户身份信息、业务系统标识、用户IP地址、单点登录服务器分组、代理所在主机的IP地址等信息。从登录请求中获取上述信息,将上述信息组合起来,其中,信息之间利用“|”进行区分。在获取到用户数据后,获取服务器中预先存储的密钥,并使用该密钥和第一预设加密算法对用户数据和凭证创建时间进行加密处理,其中,凭证创建时间为当前时间,即进行加密处理时的时间。可选地,在一些实施例中,可以将用户数据和凭证创建时间分别加密处理后,再对他们的组合结果再进行一次加密处理。
具体地,基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理的步骤包括:
基于所述密钥和第一预设加密算法对所述用户数据进行加密以生成第一加密结果,基于第二预设加密算法对所述凭证创建时间加密以生成第二加密结果;将所述第一加密结果和所述第二加密结果合成为一个字符串;基于所述第二预设加密算法对所述字符串加密处理。
例如,密钥为PK(V),凭证创建时间为cTime,则按照上述步骤加密处理后得到的结果Entoken=BASE64((AES(PK(V),Detoken)||BASE64(cTime)),其中,Detoken为用户数据。上述第一预设加密算法可以是AES算法,第二预设加密算法可以是BASE64算法,在其他实施例中,可以根据需要选择其他 加密算法。
关于上述过程中使用到的密钥,可以由单点登录服务器从其他渠道获取密钥后存储,或者由单点登录服务器按照以下步骤生成密钥:
获取当前时间,根据当前时间以及预设的基准时间生成可变因子;从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
具体地,获取当前时间cTime以及预设的基准时间bTime,计算可变因子V=(cTime-bTime)/bTime,从加密机中获取一个随机字符串SEED,对该可变因子V以及随机字符串SEED加密处理,其中第三预设加密算法可以是HMAC_SHA_1算法。生成密钥的具体过程如下:
PK(V)=HOTP(SEED,V)||HOTP(SEED,V+1),其中,“||”为连接符;
HOTP(K,C)=(HMAC_SHA_1(K’,C’)&0x7FFFFFFF)mod 10d,其中,K’为K的散列数据,C’为C的散列数据,将SEED和V分别作为K、C值带入上述公式计算得到HOTP(SEED,V)和HOTP(SEED,V+1)。采用HMAC_SHA_1算法进行HASH散列,会得到一个20字节40位的十六进制数字,mod为取余运算,与10的d次方模运算得到d位的一个数字口令。其中,HOTP是一种基于HMAC的一次性口令算法,HMAC(Hash Message Authentication Code,散列消息鉴别码)算法主要是利用哈希算法,以一个密钥和一个消息为输入,生成一个消息摘要作为输出,它可以与任何迭代散列函数捆绑使用,例如与SHA_1(Secure Hash Algorithm,安全哈希散列)算法捆绑使用构成HMAC_SHA_1算法。
按照上述方式生成token信息后,单点登录服务器将加密处理得到的结果作为token信息发送给用户终端进行存储,用户终端在后续发送的登录请求中携带该token信息,例如,向与上述业务系统之间具有信任关系的其他业务系统发送登录请求时,携带该token信息,可以实现只需要登录一次就可以访问所有相互信任的应用系统。
若登录请求中包含有token信息,则获取请求中包含的token信息和用户数据,同时记录收到该登录请求时的时间,接下来对获取到的token信息的合法性进行校验。
步骤S30,使用与第一预设加密算法对应的解密算法以及预先存储的密钥, 对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间。
步骤S40,将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值。
步骤S50,若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过。
步骤S60,否则,判定校验失败。
对token信息进行解密处理,解密的过程实质上是对上述加密过程的一个逆运算,按照第一预设加密算法和预先存储的密钥进行解密。
以Entoken=BASE64[AES(PK(V),Detoken)||BASE64(cTime)]为例,则解密时,按照如下过程:
按照BASE64.decode(BASE64[AES(PK(V),Detoken)||BASE64(cTime))运算,得到AES(PK(V),Detoken)和BASE64(cTime),再经过如下运算得到其中包含的用户数据Detoken和凭证创建时间cTime:
DeToken=BASE64.decode(AES.decode(DeToken’)),其中,DeToken’=AES(PK(V),Detoken);
cTime=BASE64.decode(cTime’),其中,cTime’=BASE64(cTime)。
将从token信息中获取到的用户数据和登录请求中包含的用户数据进行对比,同时判断token信息中包含的凭证创建时间与当前时间之间的时间差与是否小于该预设阈值,若token信息中获取到的用户数据和登录请求中包含的用户数据一致,且时间差小于该预设阈值,则校验通过,允许用户直接登录业务系统,若登录请求中包含的用户数据与token信息中包含的用户数据不一致、及/或时间差大于或等于预设阈值,判定校验失败,向用户终端返回登录界面,以供用户输入账号和密码后重新登录。需要说明的是,上述预设阈值为单点登录服务器处设置的一个token信息的有效期,当超出这个阈值,则认为该token信息失效,需要用户终端重新认证,重新获取新的token信息。
本实施例提出的单点登录的校验方法,当用户终端发送的登录器请求中携带有token信息时,从登录请求中获取用户数据和token信息,并记录接收到该登录请求的时间,使用与第一预设加密算法对应的解密算法以及预先存 储的密钥对token信息进行解密处理获取其中包含的用户数据和凭证创建时间,将登录请求中包含的用户数据与token信息中包含的用户进行对比,同时判断记录的时间与获取到的创建凭证时间之间的时间差是否小于预设阈值,若是,则判定该token消息合法,故判定校验通过,否则,判定校验失败,从上述方案可以看出,登录请求中携带的用于校验权限的token信息包含有经过加密处理的用户数据,以及一个凭证生成时间,对该token信息解密处理后,即可获取到其中的用户数据和凭证生成时间,从而与登录请求中包含的用户数据进行对比,以实现对token信息合法性的校验,该方案不需要在服务器端维护token信息与用户数据之间的映射关系,也不需要每次验证都根据映射关系查找对应的用户信息,从而实现减少需要维护的数据量,以及提高单点登录的校验效率的效果。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有单点登录的校验程序,所述单点登录的校验程序可被一个或多个处理器执行,以实现如下步骤:
当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;
否则,判定校验失败。
本申请计算机可读存储介质具体实施方式与上述单点登录的校验装置和方法各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的 优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种单点登录的校验装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的单点登录的校验程序,所述单点登录的校验程序被所述处理器执行时实现如下步骤:
    当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
    若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
    使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
    将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
    若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;
    否则,判定校验失败。
  2. 如权利要求1所述的单点登录的校验装置,其特征在于,所述单点登录的校验程序还可以被所述处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之后,以实现如下步骤:
    若所述登录请求中没有token信息,则从所述登录请求中获取用户数据,其中,所述用户数据中至少包含有用户身份信息和业务系统标识;
    将当前时间作为凭证创建时间,并获取预先存储的密钥;
    基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理;
    获取加密处理得到的字符串,将所述字符串作为token信息,并将所述 token信息发送至所述用户终端。
  3. 如权利要求2所述的单点登录的校验装置,其特征在于,所述单点登录的校验程序还可被所述处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,还实现如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  4. 如权利要求2所述的单点登录的校验装置,其特征在于,所述基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理的步骤包括:
    基于所述密钥和第一预设加密算法对所述用户数据进行加密以生成第一加密结果,基于第二预设加密算法对所述凭证创建时间加密以生成第二加密结果;
    将所述第一加密结果和所述第二加密结果合成为一个字符串;
    基于所述第二预设加密算法对所述字符串加密处理。
  5. 如权利要求4所述的单点登录的校验装置,其特征在于,所述单点登录的校验程序还可被所述处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,还实现如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  6. 如权利要求4所述的单点登录的校验装置,其特征在于,所述第一加密算法为高级加密标准AES算法,所述第二加密预设加密算法为BASE64算法。
  7. 如权利要求6所述的单点登录的校验装置,其特征在于,所述单点登录的校验程序还可被所述处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,还实现如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  8. 一种单点登录的校验方法,其特征在于,所述方法包括:
    当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
    若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
    使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
    将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
    若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;
    否则,判定校验失败。
  9. 如权利要求8所述的单点登录的校验方法,其特征在于,所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之后,所述方法还包括如下步骤:
    若所述登录请求中没有token信息,则从所述登录请求中获取用户数据,其中,所述用户数据中至少包含有用户身份信息和业务系统标识;
    将当前时间作为凭证创建时间,并获取预先存储的密钥;
    基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理;
    获取加密处理得到的字符串,将所述字符串作为token信息,并将所述token信息发送至所述用户终端。
  10. 如权利要求9所述的单点登录的校验方法,其特征在于,所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,所述方法还包括如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  11. 如权利要求9所述的单点登录的校验方法,其特征在于,所述基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理的步骤包括:
    基于所述密钥和第一预设加密算法对所述用户数据进行加密以生成第一加密结果,基于第二预设加密算法对所述凭证创建时间加密以生成第二加密结果;
    将所述第一加密结果和所述第二加密结果合成为一个字符串;
    基于所述第二预设加密算法对所述字符串加密处理。
  12. 如权利要求11所述的单点登录的校验方法,其特征在于,所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,所述方法还包括如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  13. 如权利要求11所述的单点登录的校验方法,其特征在于,所述第一加密算法为高级加密标准AES算法,所述第二加密预设加密算法为BASE64 算法。
  14. 如权利要求13所述的单点登录的校验方法,其特征在于,所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,所述方法还包括如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有单点登录的校验程序,所述单点登录的校验程序可被一个或者多个处理器执行,以实现如下步骤:
    当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息;
    若所述登录请求中包含有token信息,则从所述登录请求中获取所述token信息和用户数据,并记录接收到该登录请求的时间;
    使用与第一预设加密算法对应的解密算法以及预先存储的密钥,对所述token信息解密,以获取所述token信息中包含的用户数据和凭证创建时间;
    将所述登录请求中包含的用户数据与所述token信息中包含的用户数据进行对比,并判断记录的时间与所述凭证创建时间之间的时间差是否小于预设阈值;
    若所述登录请求中包含的用户数据与所述token信息中包含的用户数据一致、且所述时间差小于预设阈值,则判定校验通过;
    否则,判定校验失败。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述单点登录的校验程序还可被所述一个或者多个处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之后,还实现如下步骤:
    若所述登录请求中没有token信息,则从所述登录请求中获取用户数据,其中,所述用户数据中至少包含有用户身份信息和业务系统标识;
    将当前时间作为凭证创建时间,并获取预先存储的密钥;
    基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理;
    获取加密处理得到的字符串,将所述字符串作为token信息,并将所述token信息发送至所述用户终端。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述单点登录的校验程序还可被所述一个或者多个处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,还实现如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述基于所述密钥和第一预设加密算法,对所述用户数据和所述凭证创建时间进行加密处理的步骤包括:
    基于所述密钥和第一预设加密算法对所述用户数据进行加密以生成第一加密结果,基于第二预设加密算法对所述凭证创建时间加密以生成第二加密结果;
    将所述第一加密结果和所述第二加密结果合成为一个字符串;
    基于所述第二预设加密算法对所述字符串加密处理。
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述单点登录的校验程序还可被所述一个或者多个处理器执行,以在所述当接收到用户终端发送的登录请求时,判断所述登录请求中是否包含有所述token信息的步骤之前,还实现如下步骤:
    获取当前时间,根据当前时间以及预设的基准时间生成可变因子;
    从加密机中获取一个随机字符串,使用第三预设加密算法对所述随机字符串和所述可变因子加密处理,以生成所述密钥并存储。
  20. 如权利要求18所述的计算机可读存储介质,其特征在于,所述第一加密算法为高级加密标准AES算法,所述第二加密预设加密算法为BASE64算法。
PCT/CN2018/076107 2017-11-15 2018-02-10 单点登录的校验装置、方法及计算机可读存储介质 Ceased WO2019095567A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711131291.8 2017-11-15
CN201711131291.8A CN108023874B (zh) 2017-11-15 2017-11-15 单点登录的校验装置、方法及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019095567A1 true WO2019095567A1 (zh) 2019-05-23

Family

ID=62079914

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/076107 Ceased WO2019095567A1 (zh) 2017-11-15 2018-02-10 单点登录的校验装置、方法及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108023874B (zh)
WO (1) WO2019095567A1 (zh)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108809991A (zh) * 2018-06-15 2018-11-13 北京云枢网络科技有限公司 一种基于sdk动态水印的客户端合法性校验的方法
CN109190341B (zh) * 2018-07-26 2024-03-15 平安科技(深圳)有限公司 一种登录管理系统和方法
CN109639711A (zh) * 2018-12-29 2019-04-16 成都康赛信息技术有限公司 一种基于私有链会话id的分布式cas认证方法
CN109948333A (zh) * 2019-03-08 2019-06-28 北京顺丰同城科技有限公司 一种账户攻击的安全防御方法及装置
CN110191090B (zh) * 2019-04-25 2022-03-18 平安科技(深圳)有限公司 单点登录的校验方法、装置、计算机设备及存储介质
CN110417906A (zh) * 2019-08-05 2019-11-05 中国联合网络通信集团有限公司 信息调用方法及设备
CN113812125B (zh) * 2019-08-15 2023-10-20 奇安信安全技术(珠海)有限公司 登录行为的校验方法及装置、系统、存储介质、电子装置
CN112836206B (zh) * 2019-11-22 2024-07-09 腾讯科技(深圳)有限公司 登录方法、装置、存储介质和计算机设备
CN111061718A (zh) * 2019-12-19 2020-04-24 中国建设银行股份有限公司 一种数据检核方法及装置
CN111475798A (zh) * 2020-03-05 2020-07-31 深圳壹账通智能科技有限公司 多App单点登录的方法、装置、设备和存储介质
CN112019505A (zh) * 2020-07-22 2020-12-01 北京达佳互联信息技术有限公司 登录方法、装置、服务器、电子设备及存储介质
CN114124534A (zh) * 2021-11-24 2022-03-01 航天信息股份有限公司 一种数据交互系统及方法
CN115730290A (zh) * 2021-12-28 2023-03-03 北京蓝太平洋科技股份有限公司 一种单点登录方法及装置
CN114338196A (zh) * 2021-12-30 2022-04-12 湖南快乐阳光互动娱乐传媒有限公司 用户身份验证方法和装置
CN114363090B (zh) * 2022-03-02 2022-10-25 工业互联网创新中心(上海)有限公司 一种多应用系统的单点登录平台的实现方法及管理系统
CN114500097A (zh) * 2022-03-03 2022-05-13 中国农业银行股份有限公司四川省分行 一种基于Web系统单点登录的校验机制
CN115225354A (zh) * 2022-07-07 2022-10-21 通号智慧城市研究设计院有限公司 多应用单点登录方法、装置、计算机设备和介质
CN116488863A (zh) * 2023-03-14 2023-07-25 深圳前海百递网络有限公司 业务数据传输方法、计算机设备及计算机存储介质
CN117336102B (zh) * 2023-11-30 2024-03-01 北京冠程科技有限公司 一种多重校验的身份鉴别系统及其鉴别方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060520A (zh) * 2006-04-21 2007-10-24 盛趣信息技术(上海)有限公司 基于Token的SSO认证系统
CN103139200A (zh) * 2013-01-06 2013-06-05 深圳市元征科技股份有限公司 一种web service单点登录的方法
US20140082715A1 (en) * 2012-09-19 2014-03-20 Secureauth Corporation Mobile multifactor single-sign-on authentication
CN107070880A (zh) * 2017-02-16 2017-08-18 济南浪潮高新科技投资发展有限公司 一种单点登录的方法及系统、一种认证中心服务器

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1323508C (zh) * 2003-12-17 2007-06-27 上海市高级人民法院 一种基于数字证书的单点登录方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060520A (zh) * 2006-04-21 2007-10-24 盛趣信息技术(上海)有限公司 基于Token的SSO认证系统
US20140082715A1 (en) * 2012-09-19 2014-03-20 Secureauth Corporation Mobile multifactor single-sign-on authentication
CN103139200A (zh) * 2013-01-06 2013-06-05 深圳市元征科技股份有限公司 一种web service单点登录的方法
CN107070880A (zh) * 2017-02-16 2017-08-18 济南浪潮高新科技投资发展有限公司 一种单点登录的方法及系统、一种认证中心服务器

Also Published As

Publication number Publication date
CN108023874B (zh) 2020-11-03
CN108023874A (zh) 2018-05-11

Similar Documents

Publication Publication Date Title
WO2019095567A1 (zh) 单点登录的校验装置、方法及计算机可读存储介质
CN112671720B (zh) 一种云平台资源访问控制的令牌构造方法、装置及设备
CN108322469B (zh) 信息处理系统、方法和装置
US8838961B2 (en) Security credential deployment in cloud environment
CN107689869B (zh) 用户口令管理的方法和服务器
KR102493744B1 (ko) 생체 특징에 기초한 보안 검증 방법, 클라이언트 단말, 및 서버
US9646161B2 (en) Relational database fingerprinting method and system
US8997198B1 (en) Techniques for securing a centralized metadata distributed filesystem
US8863255B2 (en) Security credential deployment in cloud environment
US10135824B2 (en) Method and system for determining whether a terminal logging into a website is a mobile terminal
CN112953707A (zh) 密钥加密方法、解密方法及数据加密方法、解密方法
US10382424B2 (en) Secret store for OAuth offline tokens
KR102422183B1 (ko) 데이터에 대한 액세스 인에이블링
US9215064B2 (en) Distributing keys for decrypting client data
US11757877B1 (en) Decentralized application authentication
US10176307B2 (en) Licensing using a node locked virtual machine
WO2021137769A1 (en) Method and apparatus for sending and verifying request, and device thereof
WO2021141623A1 (en) Initializing a data storage device with a manager device
WO2019148717A1 (zh) 请求合法性的校验装置、方法及计算机可读存储介质
CN111241492A (zh) 一种产品多租户安全授信方法、系统及电子设备
JP2022534677A (ja) ブロックチェーンを使用するオンラインアプリケーションおよびウェブページの保護
CN112307515A (zh) 基于数据库的数据处理方法、装置、电子设备和介质
CN110071937B (zh) 基于区块链的登录方法、系统及存储介质
WO2013170822A2 (zh) 处理登陆服务器的密码的方法和装置
CN119135428A (zh) 基于目标服务器和终端的分布式授权认证方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18877986

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC , EPO FORM 1205A DATED 13.08.2020.

122 Ep: pct application non-entry in european phase

Ref document number: 18877986

Country of ref document: EP

Kind code of ref document: A1