| 1 |
.. _userguide_understanding_service_accounts: |
| 2 |
|
| 3 |
Understanding Service Accounts |
| 4 |
============================== |
| 5 |
|
| 6 |
Some clients registered in Globus may operate as independent "service accounts", |
| 7 |
distinct actors with their own identities. |
| 8 |
These are also referred to as "client identities" because the actor in question |
| 9 |
is the client itself. |
| 10 |
Service accounts are useful for a wide range of automation tasks, in which users |
| 11 |
want to leverage Globus APIs, but without handling login flows and user |
| 12 |
credentials. |
| 13 |
|
| 14 |
Service Accounts are Clients |
| 15 |
---------------------------- |
| 16 |
|
| 17 |
To create a service account, users must register a new Globus Auth client as |
| 18 |
a Service Account, capable of performing a *client credentials grant* to get |
| 19 |
its tokens. |
| 20 |
Once it is so registered, such a client will have an ID and secret, which can be |
| 21 |
passed into interfaces in the SDK. |
| 22 |
|
| 23 |
The client credentials (ID and secret) are used to get tokens to power |
| 24 |
interactions with Globus APIs, and SDK's :class:`globus_sdk.GlobusApp` and |
| 25 |
:class:`globus_sdk.ClientCredentialsAuthorizer` will automatically cache and |
| 26 |
reload these tokens appropriately. |
| 27 |
|
| 28 |
.. note:: |
| 29 |
|
| 30 |
In order to be used as a Service Account, a client must have an ID and secret. |
| 31 |
However, not every client with an ID and secret supports this usage! Clients |
| 32 |
may be registered with various different OAuth2 grant types enabled, and some |
| 33 |
clients have an ID and secret but are used to authenticate user logins! |
| 34 |
|
| 35 |
Put another way: having client credentials is *necessary but not sufficient* |
| 36 |
for this kind of usage. |
| 37 |
|
| 38 |
|
| 39 |
Disambiguation: "Clients" vs "Client Identities" vs "Service Accounts" |
| 40 |
---------------------------------------------------------------------- |
| 41 |
|
| 42 |
There are two different meanings for the word "client", from different domains. |
| 43 |
|
| 44 |
Conventionally, a library's adapter for a web API is a "client". |
| 45 |
In the SDK, we primarily use the word "client" to refer to these API connectors, |
| 46 |
as in ``TransferClient``, ``GroupsClient``, etc. |
| 47 |
|
| 48 |
OAuth2 calls an application registered with the service a "client". |
| 49 |
A "Client Identity" is a Globus Auth concept which uses this meaning of |
| 50 |
"client". |
| 51 |
|
| 52 |
As a result of this ambiguity, this documentation will prefer to refer to |
| 53 |
"Client Identities" as "Service Accounts", which is the term which is used in |
| 54 |
other Globus documentation and the web interface. |
| 55 |
|
| 56 |
|
| 57 |
Service Account Permissions |
| 58 |
--------------------------- |
| 59 |
|
| 60 |
Service Accounts have their own assigned identities, group memberships, and |
| 61 |
permissions within Globus. |
| 62 |
They are not implicitly linked in any way to the user who created them, or the |
| 63 |
administrators who manage them. |
| 64 |
Their permissions are isolated. |
| 65 |
|
| 66 |
Users of Service Accounts need to separately assign permissions to these |
| 67 |
identities, depending on what resources the client is meant to access. |
| 68 |
|
| 69 |
|
| 70 |
Policies Which Conflict With Service Accounts |
| 71 |
--------------------------------------------- |
| 72 |
|
| 73 |
A number of the configurable policies on Globus resources conflict with use of |
| 74 |
Service Accounts. |
| 75 |
Users often find that they cannot substitute Service Accounts for their own |
| 76 |
credentials without also adapting their workflows or configurations to support |
| 77 |
this usage. |
| 78 |
|
| 79 |
In particular, users should be aware of the following classes of issues, and |
| 80 |
potential workarounds. |
| 81 |
|
| 82 |
Identity-specific Permissions |
| 83 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 84 |
|
| 85 |
Because clients are not associated with their owners, identity-specific |
| 86 |
permissions for users can't be directly "shared" with their clients. |
| 87 |
|
| 88 |
If your account has permissions to access a resource, but you wish to use a |
| 89 |
Service Account to interact with it, add a second permission to give the Service |
| 90 |
Account access as well. |
| 91 |
|
| 92 |
Domain Requirements |
| 93 |
~~~~~~~~~~~~~~~~~~~ |
| 94 |
|
| 95 |
Resources may apply policies which require a specific domain for users. |
| 96 |
For example, a University of Chicago Collection may require ``uchicago.edu`` |
| 97 |
usernames. |
| 98 |
|
| 99 |
Service Accounts have a fixed domain of ``clients.auth.globus.org`` and |
| 100 |
therefore cannot satisfy these requirements. |
| 101 |
|
| 102 |
Use user-specific access policies or permissions delegation features, like Guest |
| 103 |
Collections, to allow Service Accounts to specifically access resources. |
| 104 |
|
| 105 |
Session Timeouts |
| 106 |
~~~~~~~~~~~~~~~~ |
| 107 |
|
| 108 |
Globus resources may configure authentication timeouts, forcing users to |
| 109 |
reauthenticate within a fixed time window to use a resource. |
| 110 |
This is done by checking the Globus Auth session associated with the user's |
| 111 |
tokens for last authentication times. |
| 112 |
|
| 113 |
For example, a Collection may require that users have logged in within the last |
| 114 |
hour to access data -- this is part of the suite of features for High Assurance |
| 115 |
data access. |
| 116 |
|
| 117 |
A Service Account authenticates each time it fetches a token, but does not have |
| 118 |
a Globus Auth session associated with those authentications. (There is no |
| 119 |
browser session interaction in such cases.) |
| 120 |
As such, a Service Account cannot satisfy these policies under a naive |
| 121 |
interpretation. |
| 122 |
|
| 123 |
Globus Connect Server implements a special rule to handle this case: session |
| 124 |
timeouts are never enforced on Service Accounts. |
| 125 |
Other services may implement similar policies or require that access to Service |
| 126 |
Accounts be configured separately from regular user permissions. |