Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a method for configuring resource access rights according to a first embodiment of the present invention. The embodiment can be applied to the situation that when any government affair authentication platform accesses a corresponding third party application, the resource access authority in the government affair authentication platform is configured for the third party application. The method for configuring the resource access rights provided by the embodiment of the invention can be implemented by a device for configuring the resource access rights provided by the embodiment of the invention, and the device can be implemented in a software and/or hardware mode and is integrated in computer equipment for executing the method.
Specifically, referring to fig. 1, the method specifically includes the following steps:
S110, responding to an access instruction of the third party application for the government affair authentication platform, and determining an application identifier of the third party application, and a resource identifier and a version number of each government affair resource associated with the government affair authentication platform.
Specifically, the government affair authentication platform is a pre-developed government affair system for realizing various corresponding government affair functions in any government affair field, supports access to different third party applications, and authenticates the identity of the third party applications, so that different users can check the government affair information under the corresponding government affair functions of the government affair authentication platform through the third party applications accessed by the government affair authentication platform. For example, the government certification platform may be a pre-developed education department platform, and the third party application may be a campus network application developed for each school to which the education department platform supports access, or the like.
Corresponding government departments and personnel are arranged in each government authentication platform according to the hierarchical division, and in consideration of the fact that a third party application usually adopts identification information such as account numbers of a government department or personnel to check the government function information which supports the government department or personnel to access in the government authentication platform, namely, when the third party application accesses the government authentication platform, the operation authority of the corresponding government department and personnel arranged in the government authentication platform needs to be opened for the third party application, so that the third party application has the authority to enter the government authentication platform to check all the function information. Therefore, when the third party application accesses the government affair authentication platform, each government affair resource needing to be configured with access authority in the third party application can be a corresponding government affair department, personnel and the like arranged in the government affair authentication platform, and the third party application adopts the identification information of the corresponding government affair department, personnel and the like to enter the government affair authentication platform to check each supported function information.
Meanwhile, in consideration of the fact that corresponding government departments, personnel and the like arranged in the government certification platform can change, the access authority to the government resources can also change, so that in order to ensure the accuracy of the access authority of the government resources, the version numbers of the government resources are recorded in real time to represent the latest version of the government resources.
In order to ensure the comprehensiveness of each government resource in the government certification platform, the government service system forms a corresponding organization architecture tree according to the hierarchical relationship among the government resources (such as government departments and personnel arranged under the government certification platform) in each government certification platform, and the identification information of the government resources under the corresponding hierarchy is stored on each node of the organization architecture tree. At this time, when the government resources in the government certification platform change, for example, departments and personnel in the government certification platform change, the organization architecture tree formed on the government service system is correspondingly updated, so as to ensure the accuracy of each government resource in the government certification platform.
In this embodiment, when a third party application requests to access a certain government affair authentication platform, the government affair authentication platform receives an access instruction sent by the third party application, and in order to configure access rights for each government affair resource in each accessed government affair authentication platform for the third party application, in this embodiment, the government affair authentication platform forwards the received access instruction to a government affair service system, and the government affair service system configures resource access rights for the government affair authentication platform for the third party application according to an organization architecture tree preformed for the government affair authentication platform by the government affair service system.
Specifically, in response to an access instruction of a third party application for the government affair authentication platform, firstly, a resource identifier and a version number of each government affair resource associated in the government affair authentication platform are searched from a preformed organization architecture tree, so that the access authority of the third party application to each government affair resource in the government affair authentication platform is configured by adopting the resource identifier and the version number together. In addition, in order to avoid the leakage of access rights to a certain government resource between different third party applications, and enable the third party application without access rights to illegally access the government resource by utilizing the leaked access rights, the embodiment further determines an application identifier of the third party application, and subsequently, the application identifier is also adopted to jointly configure the access rights of the third party application to each government resource in the government authentication platform, so as to ensure that the access rights of different third party applications to the same government resource are different.
It should be noted that, in this embodiment, the application identifier of the third party application may be an 8-byte binary code, which is denoted as app_id; the resource identifier of any government resource can be a 24-byte binary code, which is marked as UID, the version number of the government resource can be a 4-byte binary code, which represents the self-increasing serial number of the government resource when the government resource changes in the government certification platform each time, and the government resource is marked as U_V.
S120, encrypting the application identifier, the resource identifier and the version number of each government resource to obtain the access identifier of the government resource for the third party application.
Optionally, the third party application, after accessing to the government affair authentication platform, requires the third party application to be able to access information of each government affair resource associated with the government affair authentication platform, so that the embodiment configures access authority of the third party application to each government affair resource associated with the government affair authentication platform.
Specifically, for each government resource, the embodiment uses the application identifier of the third party application, and the resource identifier and version number of the government resource to jointly configure the access authority of the third party application to the government resource. The application identifier of the third party application, the resource identifier of the government resource and the version number can be encrypted together through the generated secret key of the third party application, so that the access identifier of the government resource for the third party application is obtained, and the subsequent third party application can access the government resource through the access identifier. The above operation is performed for each government resource, and then the access identifier of each government resource for the third party application can be obtained, at this time, because the access identifier carries the application identifier of the third party application, the access identifiers of different third party applications for the same government resource are different, and the access identifier configured for a certain government resource on a certain third party application cannot realize the access of another third party application for the government resource, thereby ensuring the security of resource access and avoiding illegal access of the third party application for a certain government resource.
For each government resource, the application identifier of the third party application, the resource identifier and the version number of the government resource are combined, and the identification information after the government resource is combined is encrypted to obtain the access identifier of the government resource for the third party application. That is, for each government resource, the application identifier of the third party application and the resource identifier and version number of the government resource may be combined, for example, the application identifier app_id is in the low 8 byte position, the resource identifier UID of the government resource is in the middle 24 byte position, and the version number u_v of the government resource is in the high 4 byte position, so as to splice to a new UID with 36 byte length, then the new UID is encrypted by adopting the key generated by the third party application, and after Base64 encoding, the access identifier of the government resource for the third party application is generated, and the access identifier is 48 bytes binary code and is recorded as app_uid, which represents the identifier code of the third party application for the government resource.
S130, issuing access identification of each government resource to the third party application to configure resource access authority of the third party application facing the government authentication platform.
Optionally, after determining the access identifier of the third party application to each government resource in the government authentication platform, the access identifier of each government resource is directly issued to the third party application, so that the third party application can store the access identifier of each government resource in the government authentication platform after accessing the government authentication platform, and the subsequent third party application can check the function information of the government resource in the government authentication platform by adopting the access identifier of any government resource, thereby realizing the resource access authority configuration of the third party application facing the government authentication platform.
For example, after the third party application receives the access identifier of each government resource, the access identifier of each government resource may be recorded in a preset authority configuration table by adopting a key value pair manner, so as to configure the resource access authority of the third party application facing the government authentication platform. At this time, when the function information of a certain government resource needs to be checked by logging in the accessed government authentication platform, the access identifier of the government resource can be directly obtained from the authority configuration table, and then the government authentication platform is logged in by adopting the access identifier of the government resource.
After receiving an access instruction of a third party application for a government service authentication platform, the technical scheme provided by the embodiment determines an application identifier of the third party application and a resource identifier and version number of each government service resource associated with the government service authentication platform, encrypts the application identifier and the resource identifier and the version number of each government service resource for each government service resource to obtain an access identifier of the government service resource for the third party application, so that the access identifiers configured by each government service resource on different third party applications are different, and the access identifier configured by a certain third party application for a certain government service resource cannot realize the access of another third party application to the government service resource, thereby ensuring the security of resource access; furthermore, the access identification of each government resource is issued to the third party application, so that the resource access authority configuration of the third party application facing the government authentication platform is realized, and the convenience and the high efficiency of the resource access authority configuration are improved.
Example two
Fig. 2 is a flowchart of a method for configuring resource access rights according to a second embodiment of the present invention. The embodiment of the invention is optimized based on the embodiment. Optionally, the embodiment mainly explains the specific configuration process and the configuration updating process of the resource access authority of the government authentication platform for the third party application in detail.
Specifically, referring to fig. 2, the method of this embodiment may specifically include:
And S210, determining an application identifier of the third party application, and resource identifiers and version numbers of government resources associated with the government authentication platform in response to an access instruction of the third party application for the government authentication platform.
S220, randomly generating an encryption key of the third party application so as to encrypt an application identifier and a resource identifier and a version number of each government resource.
Optionally, in order to facilitate subsequent encryption of the application identifier of the third party application and the resource identifier and version number of each government resource, in this embodiment, an encryption key is first randomly generated for the third party application, where the encryption key may be a key with a length of 32 bytes and is denoted as app_k. And then, storing the encryption key pre-generated by the third party application into a corresponding storage system so as to encrypt an application identifier, a resource identifier and a version number of each government resource by adopting the encryption key for each government resource.
And S230, authenticating the government identity of the third party application, and encrypting the application identifier, the resource identifier of the government resource and the version number of the government resource aiming at each government resource after the authentication is passed.
In this embodiment, in order to ensure validity of each third party application accessed by the government affair authentication platform, before receiving an access instruction of the third party application for the government affair authentication platform, the embodiment first needs to authenticate the government affair identity of the third party application before configuring the resource access authority of the government affair authentication platform for the third party application, for example, when a campus network application of a certain school requests access to the education platform, first needs to authenticate whether the school is a true school authenticated by the education platform, and then after authentication of the third party application passes, the application identifier, the resource identifier and the version number of the government affair resource are encrypted for each government affair resource, so as to configure the resource access authority of the third party application for the government affair authentication platform.
S240, encrypting the application identifier, the resource identifier and the version number of each government resource to obtain the access identifier of the government resource for the third party application.
S250, issuing access identification of each government resource to the third party application to configure resource access authority of the third party application facing the government authentication platform.
And S260, responding to the resource updating operation of the government affair authentication platform or responding to the configuration updating request of the third party application, and issuing the access identification of each government affair resource updated by the government affair authentication platform to the third party application so as to perform configuration updating on the resource access authority of the third party application facing the government affair authentication platform.
Optionally, when resources such as departments and personnel in the government affair authentication platform change, the organization tree structure in the government affair service system also changes, so that the configured resource access rights in each application also need to be relatively adjusted, and therefore, the resource access rights of the third party application facing the government affair authentication platform are configured, and the resource access rights are updated. At this time, the embodiment may respond to the resource update operation of the government authentication platform, and when detecting that the government resources in the government authentication platform have variation, the steps of S210-S240 are re-executed, determine the access identifier of the third party application for each updated government resource in the government authentication platform, and then actively issue the access identifier of each updated government resource in the government authentication platform to the third party application, so as to update the configuration of the resource access authority of the third party application for the government authentication platform. Or the third party application may report the configuration update request for the resource access rights in the government authentication platform to the government service system periodically, the government service system may re-execute the steps of S210-S240 in response to the configuration update request of the third party application, determine the access identifier of the third party application for each updated government resource in the government authentication platform, and then issue the access identifier of each updated government resource in the government authentication platform to the third party application, so as to update the resource access rights of the third party application for the government authentication platform periodically, thereby simplifying complexity of configuration maintenance of the resource access rights in the third party application, and improving efficient and convenient maintenance of the configuration of the resource access rights in the third party application.
After receiving an access instruction of a third party application for a government service authentication platform, the technical scheme provided by the embodiment determines an application identifier of the third party application and a resource identifier and version number of each government service resource associated with the government service authentication platform, encrypts the application identifier and the resource identifier and the version number of each government service resource for each government service resource to obtain an access identifier of the government service resource for the third party application, so that the access identifiers configured by each government service resource on different third party applications are different, and the access identifier configured by a certain third party application for a certain government service resource cannot realize the access of another third party application to the government service resource, thereby ensuring the security of resource access; furthermore, the access identification of each government resource is issued to the third party application, so that the resource access authority configuration of the third party application facing the government authentication platform is realized, and the convenience and the high efficiency of the resource access authority configuration are improved.
Example III
Fig. 3 is a flowchart of a method for configuring resource access rights according to a third embodiment of the present invention. The embodiment of the invention is optimized based on the embodiment. Optionally, in this embodiment, a detailed explanation is mainly made on a specific access process of a third party application for accessing a certain government resource in a government authentication platform after a resource access authority of the third party application for the government authentication platform is configured.
Specifically, referring to fig. 3, the method of this embodiment may specifically include:
And S310, determining an application identifier of the third party application, and resource identifiers and version numbers of government resources associated with the government authentication platform in response to an access instruction of the third party application for the government authentication platform.
S320, encrypting the application identifier, the resource identifier and the version number of each government resource to obtain the access identifier of the government resource for the third party application.
S330, issuing access identification of each government resource to the third party application to configure resource access rights of the third party application to the government authentication platform.
S340, in response to the access request of the third party application to the target resource, decrypting the access identifier of the target resource to obtain the resource identifier of the target resource.
Optionally, after the resource access authority facing the government affair authentication platform is configured in the third party application, the third party application can access any government affair resource in the government affair authentication platform, at this time, the third party application can report an access request for the target resource to the government affair authentication platform, the government affair authentication platform forwards the access request to the government affair service system, and the government affair service system checks the detailed information of the target resource.
Specifically, in response to an access request of a third party application to a target resource, the government service system firstly analyzes the access identifier of the target resource from the access request, and then decrypts the access identifier of the target resource, thereby obtaining the resource identifier of the target resource, so that the resource identifier of the target resource is utilized later, the resource access information of the target resource is searched out, and the resource access information is issued to the third party application.
In addition, when decrypting the access identifier of the target resource, the decryption result of the access identifier of the target resource may further include a corresponding target application identifier and a target version number. At this time, in order to ensure the access security of the target resource, the embodiment compares the target application identifier with the application identifier of the third party application, if the two are consistent, the embodiment continues to compare the target version number with the version number of the target resource, so as to utilize the resource identifier of the target resource to issue the resource access information of the target resource to the third party application when the two are consistent; and if the target application identification is inconsistent with the application identification of the third party application or the target version number is inconsistent with the version number of the target resource, issuing an illegal access message of the target resource to the third party application.
That is, the application identifier of the third party application is verified by using the target application identifier in the access identifier of the target resource, and whether the access identifier of the target resource is configured by the third party application when accessing the government service authentication platform or configured by other third party applications and forwarded to the third party application is determined. When the third party application and the third party application are consistent, the third party application is a legal application accessing the government affair authentication platform, then the target version number in the resource identification of the target resource is continuously adopted to verify the version number of the target resource, whether the target resource is changed after the third party application accesses the government affair authentication platform is judged, and only when the version number of the target resource is consistent with the version number of the target resource, the third party application is determined to have the authority of accessing the target resource, and then the resource identification of the target resource is utilized to check the resource access information of the target resource.
S350, utilizing the resource identification of the target resource, issuing resource access information of the target resource to the third party application.
Optionally, when the third party application is determined to be legal for access, the resource identifier of the target resource can be used to find the resource access information of the target resource in the government affair authentication platform and send the resource access information to the third party application, so as to realize the safe access of the government affair resource.
It should be noted that, in order to ensure reasonable distinction between resource access authority configuration and resource security access by the third party application, two types of different interfaces, such as an interface a for checking data authority and an interface B without data authority, are set in this embodiment, the configuration operation of the third party application for the resource access authority of the government service authentication platform is executed through the interface a, and the security access operation of the third party application for a certain target resource in the government service authentication platform is executed through the interface B.
According to the technical scheme provided by the embodiment, after the resource access authority configuration of the third-party application for the government affair authentication platform is realized, the third-party application can judge whether the third-party application is legally accessed through the application identifier, the resource identifier and the version number in the access identifier of the target resource, at the moment, the access identifiers configured on different third-party applications of each government affair resource are different, the access identifier configured on one third-party application for one government affair resource cannot realize the access of the other third-party application to the government affair resource, and the security of resource access is ensured.
Example IV
Fig. 4 is a schematic structural diagram of a device for configuring resource access rights according to a fourth embodiment of the present invention, where, as shown in fig. 4, the device may include:
an application access response module 410, configured to determine an application identifier of a third party application and a resource identifier and a version number of each government resource associated with the government authentication platform in response to an access instruction of the third party application to the government authentication platform;
The access identifier determining module 420 is configured to encrypt, for each government resource, the application identifier, and the resource identifier and version number of the government resource, to obtain an access identifier of the government resource for the third party application;
And the access right configuration module 430 is configured to issue an access identifier of each government resource to the third party application, so as to configure the resource access right of the third party application facing the government authentication platform.
After receiving an access instruction of a third party application for a government service authentication platform, the technical scheme provided by the embodiment determines an application identifier of the third party application and a resource identifier and version number of each government service resource associated with the government service authentication platform, encrypts the application identifier and the resource identifier and the version number of each government service resource for each government service resource to obtain an access identifier of the government service resource for the third party application, so that the access identifiers configured by each government service resource on different third party applications are different, and the access identifier configured by a certain third party application for a certain government service resource cannot realize the access of another third party application to the government service resource, thereby ensuring the security of resource access; furthermore, the access identification of each government resource is issued to the third party application, so that the resource access authority configuration of the third party application facing the government authentication platform is realized, and the convenience and the high efficiency of the resource access authority configuration are improved.
Further, the above access identifier determining module 420 may be specifically configured to:
and combining the application identifier of the third party application, the resource identifier and the version number of the government resource aiming at each government resource, and encrypting the identification information after the government resource combination to obtain the access identifier of the government resource for the third party application.
Further, the device for configuring the resource access right may further include:
And the key generation module is used for randomly generating an encryption key of the third party application so as to encrypt the application identifier, the resource identifier of the government resource and the version number of the government resource aiming at each government resource.
Further, the device for configuring the resource access right may further include:
And the configuration updating module is used for responding to the resource updating operation of the government affair authentication platform or responding to the configuration updating request of the third party application, and issuing the access identifier of each government affair resource updated by the government affair authentication platform to the third party application so as to perform configuration updating on the resource access authority of the third party application facing the government affair authentication platform.
Further, the device for configuring the resource access right may further include:
and the application authentication module is used for authenticating the government identity of the third party application so as to encrypt the application identifier, the resource identifier of the government resource and the version number of each government resource after the authentication is passed.
Further, the device for configuring the resource access right may further include:
The access identifier decryption module is used for decrypting the access identifier of the target resource to obtain the resource identifier of the target resource in response to the access request of the third party application to the target resource;
And the resource access module is used for transmitting the resource access information of the target resource to the third party application by utilizing the resource identification of the target resource.
Further, the decryption result of the access identifier of the target resource may further include a corresponding target application identifier and a target version number.
Correspondingly, the device for configuring the resource access authority may further include:
The access verification module is used for comparing the target application identifier with the application identifier of the third party application, if the target application identifier and the application identifier of the third party application are consistent, the target version number and the version number of the target resource are continuously compared, and when the target version number and the version number are consistent, the resource identifier of the target resource is utilized to issue resource access information of the target resource to the third party application;
And the legal access processing module is used for issuing illegal access information of the target resource to the third party application if the target application identifier is inconsistent with the application identifier of the third party application or the target version number is inconsistent with the version number of the target resource.
The configuration device of the resource access right provided by the embodiment is applicable to the configuration method of the resource access right provided by any embodiment, and has corresponding functions and beneficial effects.
Example five
Fig. 5 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention. As shown in fig. 5, the computer apparatus includes a processor 50, a storage device 51, and a communication device 52; the number of processors 50 in the computer device may be one or more, one processor 50 being taken as an example in fig. 5; the processor 50, the storage means 51 and the communication means 52 of the computer device may be connected by a bus or other means, in fig. 5 by way of example.
The storage device 51 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and a module, such as a module corresponding to a method for configuring resource access rights in an embodiment of the present invention (for example, an application access response module 410, an access identifier determining module 420, and an access rights configuring module 430 in a device for configuring resource access rights). The processor 50 executes various functional applications of the computer device and data processing, that is, implements the above-described configuration method of resource access rights, by running software programs, instructions, and modules stored in the storage 51.
The storage device 51 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, the storage 51 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, storage 51 may further include memory remotely located relative to multifunction controller 50, which may be connected to a computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The communication means 52 may be used to enable a network connection or a mobile data connection between the devices.
The computer equipment provided by the embodiment can be used for executing the configuration method of the resource access authority provided by any embodiment, and has corresponding functions and beneficial effects.
Example six
The sixth embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method for configuring resource access rights in any of the above embodiments. The method specifically comprises the following steps:
Responding to an access instruction of a third party application for a government affair authentication platform, determining an application identifier of the third party application, and a resource identifier and a version number of each government affair resource associated with the government affair authentication platform;
encrypting the application identifier, the resource identifier of the government resource and the version number aiming at each government resource to obtain an access identifier of the government resource for the third party application;
and issuing an access identifier of each government resource to the third party application so as to configure the resource access authority of the third party application facing the government authentication platform.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform the related operations in the method for configuring the resource access rights provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the configuration device of resource access rights, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, and various modifications and variations may be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.