Most modern applications comprise a front end user interface (UI) that may access a series of backend services. The front end may be a native application on a mobile device, a Javascript™ application in a browser, a traditional web application, and so on. The front end may make application programming interface (API) calls to access or otherwise consume resources managed in the various backend services, which may in turn call other services. Access to these resources may require authentication.
Applications may need to make API calls to several services to accomplish work for user. However, each application and service typically makes its own authorization decisions based on user attributes—usually by mapping them to a set of internal roles or permissions that the application and service maintains. This can increase the complexity in systems comprising composite applications consisting of a front end and potentially many backend services, since each component performs its own authentication processing. Some solutions have been proposed to simplify the authentication task. OAuth2, for example, is a standard framework set forth by the Internet Engineering Task Force (IETF) for abstracting authentication away from the application to an authorization service which delivers tokens to the front end UI that can be used for API calls to other services.
With respect to the discussion to follow and in particular to the drawings, it is stressed that the particulars shown represent examples for purposes of illustrative discussion, and are presented in the cause of providing a description of principles and conceptual aspects of the present disclosure. In this regard, no attempt is made to show implementation details beyond what is needed for a fundamental understanding of the present disclosure. The discussion to follow, in conjunction with the drawings, makes apparent to those of skill in the art how embodiments in accordance with the present disclosure may be practiced. Similar or same reference numbers may be used to identify or otherwise refer to similar or same elements in the various drawings and supporting descriptions. In the accompanying drawings:
In the following description, for purposes of explanation, numerous examples and specific details are set forth in order to provide a thorough understanding of embodiments of the present disclosure. Particular embodiments as expressed in the claims may include some or all of the features in these examples, alone or in combination with other features described below, and may further include modifications and equivalents of the features and concepts described herein.
In some embodiments, for example, a system 100 for providing token-based authorization may include an authorization server 102 and one or more resource servers 104-a, 104-b, 104-c. Each resource server 104-a, 104-b, 104-c may host, manage, and provide secured access to one or more respective resources 142-a, 142-b, 142-c. A resource may be information; for example, a user's personal data, credit card information, documents, etc., that can be electronically sent to a user. A resource may be physical objects; for example, a library service may manage books that can be loaned out to users. A resource may be services that a user may consume; for example, a photo printing service may provide services such as printing photographs, printing on various qualities of photographic paper, defining print jobs, deleting print jobs, etc.
In accordance with the present disclosure, a resource server 104 may expose APIs (application programming interfaces, not shown) to allow access to its respective resources 142. The resource server 104 may perform authorization checks in order to permit access to its resources 142. In accordance with the present disclosure, the resource server 104 may define permissions referred to as “service roles,” which may be associated with actions authorized to be performed on its resources 142.
In accordance with the present disclosure, the authorization server 102 may administer entities called management roles 122. In some embodiments, for example, an administrator 14 may create and administer management roles 122, for example, using information 144 that may be defined by the resource servers 104. Management roles 122 may bind service roles and resources 142 of a resource server 104 to a user or a group of users. The authorization server 102 may manage and enforce authentication policies of the user relative to the resources 142 being requested using the management roles 122. Service roles and management roles are discussed in more detail below.
The system 100 may include one or more application 106 configured to make requests to access one or more of the resources 142a-142c on behalf of a user 12. In some embodiments, the application 106 may be a native application on a mobile device, a Javascript™ application in a browser, a traditional web application, and so on. Merely for discussion purposes, for example, the application 106 may be a web server configured to interact with user 12 via web pages. The user 12 may interact with the web server using HTTP requests from a web browser (not shown). As another example, the application 106 may be a back end server for a native front end application. For example, the native front end application may be a mobile application. The user 12 may interact with the back end server using a suitable client-server protocol such as REST (representational state transfer), for example. In other embodiments, the application 106 may be a native application that the user 12 directly interacts with.
In accordance with the present disclosure, the application 106 may provide an application scope 162 to the authentication server 102, for example, at a time when the user 12 interacts with the application 106. The application scope 162 may identify or is otherwise associated with resource servers, resources, and service roles that the application 106 can expose to users who access the application 106. In accordance with the present disclosure, the authorization server 102 may return an access token 124 to the application 106. The access token 124 may identify or is otherwise associated with a set of resource servers, resources, and service roles that the application 106 can expose to a particular user 12. Stated differently, the access token may represent resource servers, resources, and service roles that the user is authorized to access or otherwise consume via the application. These aspects of the present disclosure are discussed in more detail below.
The application 106 may access resource servers 104-a, 104-b, 104-c using respective access tokens 164-a, 164-b, 164-c to access or otherwise consume respective resources 142-a, 142-b, 142-c. In some embodiments, for example, the access tokens 164 may comprise information contained in the access token 124 received from the authorization server 102.
The discussion will now turn to a more detailed description of some of the above-described components for token-based authorization in accordance with the present disclosure. In some embodiments, for example, the resources 142 in a resource server 104 may be represented using name/value pair notation. The ‘name’ may refer to a type or kind of resource, and the ‘value’ may represent an instance of the resource. In accordance with the present disclosure, the ‘name’ and ‘value’ can be arbitrary strings of text and may be defined within the resource server 104 to represent a resource. Since the resource server 104 is the entity that ultimately enforces access to its resources, the strings need only have meaning to the resource server 104. Although the name/value pairs have meaning to the resource server 104, they may be used by the authentication server 102 and application 106 to identify and access resources 142 of the resource server 104, explained below.
Consider, for example, the library service example defined in
In some embodiments, the resource server 104 itself may be viewed (e.g., by the authentication server 102 or application 106) as a resource. For example, the library service may be identified by the name/value pair: “service”=“library”. This allows for several resource servers 104-a, 104-b, 104-c to be identified by a unique name/value pair. For example, “service”=“print-service” may identify a resource server that provides printing services, “service”=“library-main” may identify the main branch of a library, “service”=“cloud-storage” may identify a cloud-based storage service, and so on.
In some embodiments in accordance with the present disclosure, the attributes of a resource 142 may be viewed as resources and may be identified using name/value pairs. For example, an attribute of a book may be its genre: mystery, romance, science, etc. Accordingly, name/value pairs may be defined for each genre; for example, “genre”=“mystery”, “genre”=“romance”, “genre”=“science”, and so on. More generally, any quality or characteristic of a resource may constitute an attribute, and may be identified by a suitable name/value pair. The library example shown in
In some embodiments, name/value pairs may include a relational operator. For example, the name/value pair “pages”<“100” may refer to books having less than 100 pages. A name/value pair may specify an exclusion; e.g., “genre”!=“mystery” may refer to books that are not mystery novels.
In some embodiments, resources may be grouped into “resource sets” to identify one or more resources 142 in a resource server 104. For example, a resource set may comprise one or more name/value pairs that identify resources. A resource set may be used to specify a group of resources; for example, the resource set {“service”=“library”, “rtype”=“book”, “rtype”=“shelf”} refers to the “book” and “shelf” resources in the library. A resource set may comprise a resource with particular attributes; for example, the resource set: {“service”=“library”, “rtype”=“book”, “genre”!=(“mystery”, “sports”), “pages”<“200”} may specify books in a library service that have less than 200 pages and are neither mystery novels nor sports related.
In some embodiments, a resource server 104 may use one or more “service roles,” which may be used to control access to its respective resources 142. The resource server 104 may use service roles to enforce actions on or access to its resources 142. Service roles may be defined within the resource server 104. A service role may refer to actual actions that can be performed on the resources 142. The library example shown in
Turning now to “application scope,” in accordance with the present disclosure. An application 106 (
Reference is made to
Referring to
As noted above, the application scope 362 represents the scope of resource servers, resources, and service roles that a given application is configured with. In some embodiments, the application may allow a user to access some or all of resource servers, resources, and service roles set forth in the application scope 362. In other embodiments, the application may present to a user only those resource components set forth in the application scope 362 that the user is allowed to access. This aspect of the present disclosure is discussed further.
Turning now to “management roles,” as noted above the authorization server 102 may contain management roles 122. A management role 122 in accordance with the present disclosure may bind or associate users with resource sets and services roles. In accordance with the present disclosure, the management role 122 defines the resource servers and resources that a user is allowed to access or otherwise consume.
Referring for a moment to
Referring to
At flow 404, the application 106 may initiate and maintain a session with the user 12. In some embodiments, the application 106 may pass control to the authorization server 102 to authenticate the user 12; for example, the authorization server 102 may invoke a login sequence with the user 12. Control may then return to the application 106 to initiate a user session with the now-authenticated user 12.
At flow 406, the application 106 may provide an application scope 162 to the authorization server 102. The application scope 162 may be provided to the authorization server 102 at the same time that it passes control to the authorization server 102 to authenticate the user 12. As explained above, the application scope 162 may represent the set of (one or more) resource servers 104-a, 104-b, their respective resources and service roles (e.g., actions) on those resources that the application 106 is configured for. The following example may provide a useful context.
Consider, for instance, a photo printing service. The resource server 104-a (
At flow 408, the authorization server 102 may return an access token 124 to the application 106. In accordance with the present disclosure, the authorization server 102 may use the identity of the user 12 and the application scope 162 to extract or otherwise generate a subset of the application scope 162 as the access token 124. The access token 124 may represent only those resource servers, resources, and service roles in the application scope 162 that the user 12 is authorized to access. Stated differently, the access token 124 may represent resource servers and respective resources that the user is authorized to access or otherwise consume via the printing application. These aspects of the present disclosure are discussed in more detail below. In the printer service example above, for instance, User-1 may only be able to print on 4×5 stock and may select from matte finish or glossy finish. Accordingly, the access token 124 for User-1 would include paper resources for only 4×5 stock with matte finish or glossy finish, and include the service role for printing. User-2 may be able to print on any size paper but only with matte finish, and may be allowed to delete their print jobs. Accordingly, the access token 124 for User-2 would include paper resources for any paper size, but only for matte finish, and include the service roles for printing and deleting print jobs.
At flow 410, the application 106 may display a user interface (UI, not shown) to interact with the user 12 during their session. In some embodiments, the UI may present only those resource servers and resources that the user 12 is authorized to access using the application 106; for example, using the access token 124. The application 106 can therefore provide a UI that is personalized for each user 12 dependent upon the scope of their authority to access the resource servers and resources. Using the printer service example above, for instance, the UI for User-1 may include a selection graphic (e.g., drop-down menu, list, etc.) that allows the user to select a matte finish or glossy finish. The UI, however, may simply indicate to User-1 that they can only print on 4×5 stock; in other words, the UI may omit any options for printing on other stock sizes. The UI for User-2 may include a selection graphic that allows the user to select from among the paper sizes that are available at the photographic print server; the UI, however, may indicate to User-2 that they can only print on matte finish.
At flow 412, the user 12 may interact with their personalized UI to access one or more resources that the application 106 makes available to them.
At flow 414, the application 106 may communicate with one or more of the resource servers 104-a, 104-b to access the resource(s) requested by the user 12; e.g., using API calls to the resource servers 104-a. 104-b. The API calls may include respective access tokens 164 (
At flow 414a, the resource servers 104-a, 104-b may respond to the application 106. The response may indicate that the resource access was successful or not. Depending on the nature of the resource, the response may include the accessed resource itself; for example, the resource may be data such as user information, an electronic document, and the like.
Referring to
At block 502, the authorization server 102 may authenticate a user (e.g., 12,
At block 504, the authorization server 102 may access the application scope 162 (
At block 506, the authorization server 102 may access a management role 122 (
At block 508, the authorization server 102 may extract or otherwise identify a subset of the application scope 162 using the management role 122 associated with the user. The resulting subset represents resource servers, resources, and service roles that the user 12 is authorized to access with respect to the resource servers, resources, and service roles that the application 106 is configured to access. This aspect of the present disclosure is discussed in more detail below with reference to
At block 510, the authorization server 102 may send the extracted subset of the application scope 162 as an access token 124 (
Referring to
An illustrative example is provided in
Referring to
At block 604, the authorization server 102 may process each (app scope) entry 662a-662c in the application scope 662 for a given m-role entry from the management role 622.
At block 606, the authorization server 102 may perform an INTERSECTION set operation between the resource set of the given m-role entry and the resource set of a given app scope entry. In some embodiments, resources in a resource set may not necessarily be in any particular order. Accordingly, in some embodiments, each resource (expressed as a name/value pair) in one resource set (e.g., of the m-role entry) may be compared with each resource in the other resource set (e.g., in the app scope entry) to determine a match. In particular, the name/value pair of a resource in one resource set may be AND'd with the name/value pairs of the resources in the other resource set; if a match between the name and a match between the value occurs, then that name/value pair will be placed in an output set of the INTERSECTION operation. Consider, for example, the resource sets of the m-role entry 622a and the app scope entry 662a. It can be seen that the INTERSECTION operation between these two resource sets would produce the resulting output set {“service”=“print-service”, “queue”=“matte”}; the resource “service”=“print-service”” and the resource “queue”=“matte” are common to both the m-role entry and the 622a app scope entry 662a. The resource “queue”=“glossy” is not common to both the m-role entry and the 622a app scope entry 662a, and so is omitted from the output set.
At block 608, if the INTERSECTION operation of block 606 results in an empty output set, then none of the resources in the resource set of the given app scope entry matched any of the resources in the resource set of the given m-role entry. Processing in the authorization server 102 may return to block 604 (Y branch) to process the next entry in the application scope. If, on the other hand, the output set is not empty (i.e., contains at least one common resource), then processing in the authorization server 102 may proceed to block 610 (N branch).
At block 610, the authorization server 102 may perform an INTERSECTION operation between the service role set of the given m-role entry and the service role set of a given app scope entry. Service roles in a service role set are not necessarily in any particular order. Accordingly, in some embodiments, each service role in one service role set may be compared with each service role in the other service role set to find a match. In particular, a service role in one service role set may be AND′d with the service roles in the other service role set. If a match occurs, then that service role will be placed in an output set of the INTERSECTION operation. Consider, for example, the service role sets of the m-role entry 622a and the app scope entry 662a. It can be seen that the INTERSECTION operation between these two resource sets would produce the resulting output set {“print”}; the service role “print” is common to both the m-role entry 622a and the app scope entry 662a. The service role “delete print job” is not common to both the m-role entry 622a and the app scope entry 662a, and so is omitted from the output set.
At block 612, if the INTERSECTION operation of block 610 results in an empty output set, then none of the service roles in the service role set of the given app scope entry matched any of the service roles in the service role set of the given m-role entry. Processing in the authorization server 102 may return to block 604 (Y branch) to process the next entry in the application scope. Thus, even if there were some resource matches in block 610, an empty output set from the processing in block 612 means user John Smith is not authorized to perform any actions, so no further processing is needed. If, on the other hand, the output set is not empty (i.e., contains at least one common service role), then processing in the authorization server 102 may proceed to block 614 (N branch).
At block 614, the authorization server 102 has an output set from the INTERSECTION operation of the resource sets of the given app scope entry and the given m-role entry, and an output set from the INTERSECTION operation of the service role sets. This means that user John Smith is authorized with respect to at least on resource and with respect to one action. Accordingly, the authorization server 102 may associate or otherwise bind these two output sets with each other and add them to as an entry 624a, 624b in an access token 624.
Returning to block 604, after all the entries in the application scope 662 have been processed for the given m-role entry, processing in the authorization server 102 may return to block 602 to process the next m-role entry in the management role 622 for user John Smith. Processing completes when the authorization server 102 has processed all entries 622a-622c in the management role 622.
At this point, the resulting access token 624 represents only those resource servers, resources, and service roles in the given application that the user (e.g., John Smith) is authorized to access. For example, while the given application can provide a user access to resource server “srvr-5”, user John Smith is not authorized to access that resource server. Moreover, while user John Smith has access to resource server “srvr-3”, the user can only access resources rsrc-31 and rsrc-33 on that resource server, even the given application is configured to provide access to resource rsrc-32.
The entries 624a, 624b of access token 624 shown in
Referring to
The processing unit 712 may comprise a single-processor configuration, or may be a multi-processor architecture. The system memory 714 may include read-only memory (ROM) and random access memory (RAM). The internal data storage device 716 may be an internal hard disk drive (HDD), a magnetic floppy disk drive (FDD, e.g., to read from or write to a removable diskette), an optical disk drive (e.g., for reading a CD-ROM disk, or to read from or write to other high capacity optical media such as the DVD, and so on).
The internal data storage device 716 and its associated non-transitory computer-readable storage media provide nonvolatile storage of data, data structures, computer-executable instructions, and so forth. Although the description of computer-readable media above refers to a HDD, a removable magnetic diskette, and a removable optical media such as a CD or DVD, it is noted that other types of media which are readable by a computer, such as zip drives, magnetic cassettes, flash memory cards, cartridges, and the like, may also be used, and further, that any such media may contain computer-executable instructions for performing the methods disclosed herein.
The system memory 714 and/or the internal data storage device 716 may store various program and data modules 718, including for example, operating system 732, one or more application programs 734, program data 736, and other program/system modules 738. For example, the application programs 734, which when executed, may cause the computer system 702 to perform method steps of
An external data storage device 742 may be connected to the computer system 702. For example, the external data storage device 742 may serve as a data store for management roles 122 (
The computer system 702 may operate in a networked environment using logical connections via wired and/or wireless communications to one or more remote computers (e.g. resource servers 104,
Direct access to the computer system 702 may be provided by a suitable input device 744 (e.g., keyboard, mouse, touch pad, etc.) and a suitable output device 746, (e.g., display screen) connected to the computer system 702. In some embodiments, access may be made remotely, for example, over a communication network.
The various embodiments described herein may employ various computer-implemented operations involving data stored in computer systems. For example, these operations may require physical manipulation of physical quantities. Usually, though not necessarily, these quantities may take the form of electrical or magnetic signals, where they or representations of them are capable of being stored, transferred, combined, compared, or otherwise manipulated. Further, such manipulations are often referred to in terms, such as producing, identifying, determining, or comparing. Any operations described herein that form part of one or more embodiments may be useful machine operations. In addition, one or more embodiments also relate to a device or an apparatus for performing these operations. The apparatus may be specially constructed for specific required purposes, or it may be a general purpose computer selectively activated or configured by a computer program stored in the computer. In particular, various general purpose machines may be used with computer programs written in accordance with the teachings herein, or it may be more convenient to construct a more specialized apparatus to perform the required operations.
One or more embodiments may be implemented as one or more computer programs or as one or more computer program modules embodied in one or more computer readable storage media. The term computer readable storage medium refers to any data storage device that can store data which can thereafter be input to a computer system—computer readable media may be based on any existing or subsequently developed technology for embodying computer programs in a manner that enables them to be read by a computer. Examples of a non-transitory computer readable medium include a hard drive, network attached storage (NAS), read-only memory, random-access memory (e.g., a flash memory device), a CD (Compact Discs)—CD-ROM, a CD-R, or a CD-RW, a DVD (Digital Versatile Disc), a magnetic tape, and other optical and non-optical data storage devices. The computer readable medium can also be distributed over a network coupled computer system so that the computer readable code is stored and executed in a distributed fashion.
These and other variations, modifications, additions, and improvements may fall within the scope of the appended claims(s). As used in the description herein and throughout the claims that follow, “a”, “an”, and “the” includes plural references unless the context clearly dictates otherwise. Also, as used in the description herein and throughout the claims that follow, the meaning of “in” includes “in” and “on” unless the context clearly dictates otherwise.
The above description illustrates various embodiments of the present disclosure along with examples of how aspects of the present disclosure may be implemented. The above examples and embodiments should not be deemed to be the only embodiments, and are presented to illustrate the flexibility and advantages of the present disclosure as defined by the following claims. Based on the above disclosure and the following claims, other arrangements, embodiments, implementations and equivalents may be employed without departing from the scope of the disclosure as defined by the claims.