Skip to content

Commit e8c1bdb

Browse files
committed
docs (OAuth2): add information about token revokation
1 parent 3b9dd00 commit e8c1bdb

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

docs/source/DeveloperGuide/OAuth2Authorization/index.rst

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ An OAuth 2.0 flow has the following `roles <https://datatracker.ietf.org/doc/htm
3232

3333
- **Resource Owner** - Entity that can grant access to a protected resource. In the context of DIRAC, these are DIRAC users.
3434
- **Resource Server** - Server hosting the protected resources. In the context of DIRAC, this is DIRAC backend components like a DIRAC services.
35-
- **Client** - Application requesting access to a protected resource on behalf of the *Resource Owner*. In the context of DIRAC, these are DIRAC client installations.
35+
- **Client** - Application requesting access to a protected resource on behalf of the *Resource Owner*. In the context of DIRAC, these are DIRAC client installations. The client may also be a DIRAC component, such as a service or agent, that uses a user access token to access DIRAC services.
3636
- **Authorization Server** - Server that authenticates the *Resource Owner* and issues access tokens after getting proper authorization. In the context of DIRAC, this is DIRAC Authorization Server.
3737

3838
OAuth 2.0 grants
@@ -178,10 +178,10 @@ Using the local certificate ``dirac-login`` makes a similar algorithm as :ref:`d
178178
#) If the connection was successful, a command generate a proxy certificate with the required extensions.
179179
#) A proxy certificate without extensions upload to :py:class:`~DIRAC.FrameworkSystem.DB.ProxyDB.ProxyDB` using :py:class:`~DIRAC.FrameworkSystem.Service.ProxyManagerHandler.ProxyManagerHandler`.
180180

181-
Using ``dirac-login my_group --use-diracas --proxy``:
181+
Using ``dirac-login my_group --use-diracas --token``:
182182

183-
.. image:: /_static/Systems/FS/OAuth2/diracasProxyFlow.png
184-
:alt: DIRAC CLI login DIRAC AS flow and obtaining a proxy certificate.
183+
.. image:: /_static/Systems/FS/OAuth2/diracasTokenFlow.png
184+
:alt: DIRAC CLI login DIRAC AS flow and obtaining an access token.
185185

186186
User do not need to have a locally installed certificate if logging in through DIRAC AS.
187187

@@ -213,10 +213,10 @@ Back to OAuth 2.0 Device flow:
213213
#) DIRAC AS encrypts the refresh token and stores it in :py:class:`~DIRAC.FrameworkSystem.DB.AuthDB.AuthDB`.
214214
#) DIRAC AS responds with an access and encripted refresh token.
215215

216-
Using ``dirac-login my_group --use-diracas --token``:
216+
Using ``dirac-login my_group --use-diracas --proxy``:
217217

218218
.. image:: /_static/Systems/FS/OAuth2/diracasProxyFlow.png
219-
:alt: DIRAC CLI login DIRAC AS flow and obtaining an access token.
219+
:alt: DIRAC CLI login DIRAC AS flow and obtaining a proxy.
220220

221221
In this case, the process differs only in that when the user successfully completes the browser flow path, DIRAC AS responds with a proxy:
222222
11) Upon receipt of a request for a proxy, DIRAC AS requests :py:class:`~DIRAC.FrameworkSystem.Service.ProxyManagerHandler.ProxyManagerHandler` to provide a proxy to the requested user and group.
@@ -244,9 +244,24 @@ DIRAC CLI
244244

245245
Using ``dirac-logout``:
246246

247-
(docs in progress)
247+
.. image:: /_static/Systems/FS/OAuth2/revokeToken.png
248+
:alt: DIRAC logout flow.
249+
250+
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:
251+
1) :ref:`dirac-logout` sends a revoke request to DIRAC AS.
252+
253+
a) DIRAC AS decrypts the refresh token and reads to whom it belongs.
254+
#) DIRAC AS makes a revoke request to the appropriate IdP.
255+
#) DIRAC AS remove record about this refresh token in ``AuthDB`` database.
256+
257+
2) Delete the token file.
248258

249259
Web portal
250260
==========
251261

262+
Click on the username to select "Log out".
263+
264+
.. image:: /_static/Systems/FS/OAuth2/revokeTokenWeb.png
265+
:alt: DIRAC web logout flow.
266+
252267
(docs in progress)
36.5 KB
Loading
52.9 KB
Loading

0 commit comments

Comments
 (0)