You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/AdministratorGuide/ServerInstallations/environment_variable_configuration.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,4 +73,4 @@ BEARER_TOKEN_FILE
73
73
If the environment variable is set, then its value is interpreted as a filename. The content of the specified file is used as token string (https://doi.org/10.5281/zenodo.3937438).
74
74
75
75
DIRAC_USE_ACCESS_TOKEN
76
-
If this environment is set to ``true``, then when trying to connect to the server, access tokens obtained during authorization will be used (default=false)
76
+
If this environment is set to ``true``, then when trying to connect to the server, access tokens will be used (default=false)
Copy file name to clipboardExpand all lines: docs/source/DeveloperGuide/OAuth2Authorization/index.rst
+9-13Lines changed: 9 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,21 +20,21 @@ OAuth 2.0 framework
20
20
*******************
21
21
22
22
The OAuth 2.0 authorization framework is a protocol that allows a user to grant a third-party web site or application access to the user's protected resources, without necessarily revealing their long-term credentials or even their identity.
23
-
There are already many articles to familiarize yourself with this framefork, for example `Auth0 Docs <https://auth0.com/docs/authorization/protocols/protocol-oauth2>`_ or `RFCs <https://oauth.net/>`_
23
+
There are already many articles to familiarize yourself with this framework, for example `Auth0 Docs <https://auth0.com/docs/authorization/protocols/protocol-oauth2>`_ or `RFCs <https://oauth.net/>`_
24
24
25
25
The following diagram shows the main OAuth 2.0 roles in DIRAC.
:alt:OAuth 2.0 roles in context of the DIRAC components interation.
34
34
35
35
As shown in the figure, DIRAC server components, such as service or agent, may have sufficient privileges to request a user access token (or proxy). Upon receiving it, the component can access the protected resource on behalf of the user.
36
36
37
-
.. warning:: The OAuth 2.0 scheme does not involve the use of X509 certificates, but since their using is a necessity in the DIRAC, then scheme will be slightly expanded:
37
+
.. warning:: The OAuth 2.0 scheme does not involve the use of X509 certificates, but since their usage is still mandatory in DIRAC, the scheme is more complicated:
38
38
the protected resource request may contain the X509 proxy user certificate instead of the user access token.
39
39
40
40
OAuth 2.0 roles
@@ -88,7 +88,7 @@ Components
88
88
89
89
- :py:class:`~DIRAC.FrameworkSystem.private.authorization.grants` contains helper classes with descriptions of the flows to get and revoke an access token.
90
90
- :py:class:`~DIRAC.FrameworkSystem.private.authorization.utils` contains helper classes with main OAuth2 object descriptions and helper methods.
91
-
- :py:class:`~DIRAC.FrameworkSystem.private.authorization.AuthServer` inherit `authlib.oauth2.AuthorizationServer` and simulates the operation of OAuth 2 authorization server.
91
+
- :py:class:`~DIRAC.FrameworkSystem.private.authorization.AuthServer` inherits from `authlib.oauth2.AuthorizationServer` and simulates the operation of OAuth 2 authorization server.
92
92
93
93
94
94
Configuration
@@ -199,15 +199,13 @@ Using ``dirac-login my_group --use-diracas --token``:
199
199
200
200
User do not need to have a locally installed certificate if logging in through DIRAC AS.
201
201
202
-
OAuth 2.0 Device flow:
203
-
1) ``dirac-login`` initializes `OAuth 2.0 Device flow` by passing DIRAC client ID to DIRAC AS.
202
+
1) ``dirac-login`` initializes **OAuth 2.0 Device flow** by passing DIRAC client ID to DIRAC AS.
204
203
#) DIRAC AS responds with a ``device_code``, ``user_code``, ``verification_uri``, ``verification_uri_complete``, ``expires_in`` (lifetime in seconds for device_code and user_code), and polling ``interval``.
205
204
#) The command asks the user to log in using a device that has a browser(e.g.: their computer, smartphone) or if the device running ``dirac-login`` has a browser installed, a new tab with the received URL will open automatically.
206
205
207
206
a) The command begins polling DIRAC AS for an access token sending requests to token endpoint until either the user completes the browser flow path or the user code expires.
208
207
209
-
OAuth 2.0 Authorization Code flow:
210
-
4) After receiving this request from the browser, DIRAC AS will initialize ``OAuth 2.0 Authorization Code`` flow with choosed IdP. If several IdPs are registered in DIRAC and it is not clear from the requested group which one to choose, DIRAC AS will ask the user to choose one.
208
+
4) After receiving this request from the browser, DIRAC AS will initialize **OAuth 2.0 Authorization Code flow** with choosed IdP. If several IdPs are registered in DIRAC and it is not clear from the requested group which one to choose, DIRAC AS will ask the user to choose one.
211
209
#) DIRAC AS prepare authorization URL for the corresponding IdP and redirects the user to the login and authorization prompt.
212
210
#) When the user has successfully logged in, IdP redirects him back to the DIRAC AS with an authorization code.
213
211
#) DIRAC AS sends this code to the IdP along with the client credentials and recieve an ID token, access token and refresh token.
#) If ``TokenDB`` already contains tokens for the user, then the extra tokens are revoked (just one refresh token in Token Manager for the user is enough).
219
217
220
218
10) DIRAC AS update authorization session status.
221
-
222
-
Back to OAuth 2.0 Device flow:
223
-
11) Upon receipt of a request for an access token, DIRAC AS requests :py:class:`~DIRAC.FrameworkSystem.Service.TokenManagerHandler.TokenManagerHandler` to provide a fresh access token to the requested user and group.
219
+
11) Here we **back to OAuth 2.0 Device flow**. Upon receipt of a request for an access token, DIRAC AS requests :py:class:`~DIRAC.FrameworkSystem.Service.TokenManagerHandler.TokenManagerHandler` to provide a fresh access token to the requested user and group.
224
220
225
221
a) Token Manager forms a scope that corresponds to the selected group.
226
222
#) After that Token Manager makes aexchange token request to get new access and refresh tokens.
If it is a long session, ie with a refresh token, which allows you to update the access token and thus continue the working session, then to end the session it is necessary to revoke refresh token:
260
+
If it is a long session, i.e. with a refresh token, which allows you to update the access token and thus continue the working session, then to end the session it is necessary to revoke the refresh token:
265
261
1) :ref:`dirac-logout` sends a revoke request to DIRAC AS.
266
262
267
263
a) DIRAC AS decrypts the refresh token and reads to whom it belongs.
268
264
#) DIRAC AS makes a revoke request to the appropriate IdP.
269
-
#) DIRAC AS remove record about this refresh token in ``AuthDB`` database.
265
+
#) DIRAC AS removes the record about this refresh token from the ``AuthDB`` database.
0 commit comments