Skip to content

Commit 9406627

Browse files
committed
feat: add authentication documentation for REANA JupyterLab extension
1 parent f4f0796 commit 9406627

File tree

5 files changed

+82
-12
lines changed

5 files changed

+82
-12
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Authentication
2+
3+
## Token Reuse
4+
5+
The REANA JupyterLab extension automatically reuses your existing VRE-issued JWT access token - the same one that authenticated your current JupyterLab session. **No additional login or authentication steps are required** to start using REANA through the extension.
6+
7+
## Verifying Access
8+
9+
You can verify that authentication is working properly by:
10+
11+
1. Opening the REANA sidebar tab in JupyterLab
12+
2. Checking if you can see your workflows listed
13+
3. Opening a workflow detail panel to see its contents
14+
15+
If these actions succeed, your authentication is working correctly. If you see "unauthorized" errors or empty lists where you expect content, there may be an authentication issue.
16+
17+
## Troubleshooting
18+
19+
If you encounter authentication problems:
20+
21+
- **Token expired?** Restart your JupyterLab container to get a fresh token
22+
- **Still not working?** Re-login to the VRE web interface, then launch a new JupyterLab session
23+
- **Need different credentials?** Use the connection configuration panel (see below)
24+
25+
## Optional Connection Configuration
26+
27+
You can manually configure the connection to a different REANA instance by:
28+
29+
1. Opening the REANA sidebar tab
30+
2. Clicking on the connection settings icon
31+
3. Entering a custom server URL and/or access token
32+
33+
This is useful if you need to connect to a different REANA instance than the default one configured for VRE.
34+
35+
## Authentication Flow
36+
37+
![Authentication Flow](../../../../static/img/reana-extension-auth-flow.png)
38+
39+
*Authentication flow: Your VRE login generates a token that is automatically injected into your container environment and configuration, allowing the extension to access REANA resources on your behalf.*

docs/extensions/reana-jupyterlab/usage/connection.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/reana.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ Explore Reana on the software's [official documentation](https://docs.reana.io/)
55

66
You can find other examples of differen workflow languages on the [official Reana documentation](https://docs.reana.io/advanced-usage/access-control/rucio/).
77

8+
# Authentication with reana-client
9+
10+
The REANA client provides a command-line interface for authenticating with the REANA server. You can use the `reana-client auth` command which initiates an OAuth 2.0 device flow authentication:
11+
12+
```bash
13+
$ reana-client auth
14+
```
15+
16+
This command will provide you with a URL to visit and a code to enter, allowing you to authenticate through your browser. You will be taken through the OAuth 2.0 device flow process where you'll need to enter the provided code on the authorization page to complete the authentication.
17+
18+
> **Important:** When using the `reana-client auth` command, please note that the VRE JupyterLab extension may not be automatically updated with your new authentication token. If you're using both the command-line client and the JupyterLab extension, you may need to restart your JupyterLab session for the extension to recognize your new authentication status.
19+
820
# Reana - Rucio integration
921

1022
A functionality to directly upload files from a Rucio RSE to the Reana workspace has been implemented. In this way, users can immediately reproduce an analysis on Reana without having to first download files locally from Rucio and then upload them to the Reana workspace.
@@ -92,4 +104,4 @@ $ reana-client upload
92104
$ reana-client start
93105
$ reana-client status
94106
```
95-
5. Check the state of your workflow on https://reana-vre.cern.ch/.
107+
5. Check the state of your workflow on https://reana-vre.cern.ch/.

docs/tech-docs/services/computing-resources.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,33 @@ kubectl exec -i -t deployment/reana-server -n reana -- flask reana-admin token-g
6565

6666
6. Navigate to `reana-vre.cern.ch` and log in with your IAM credentials.
6767

68+
## JupyterLab REANA Extension Authentication
69+
70+
This section explains how the VRE-provided JWT used by the REANA JupyterLab extension is injected, accessed and refreshed (or not) during a user session.
71+
72+
### Token injection at spawn time
73+
During user pod creation the VRE spawner:
74+
- Obtains (or reuses) the user's already validated access token.
75+
- Injects it as an environment variable (`REANA_ACCESS_TOKEN`).
76+
- Writes a lightweight config file with the token for `reana-client` CLI
77+
78+
No refresh token is stored; only the short‑lived access token is passed.
79+
80+
### Token storage (UI extension vs CLI)
81+
UI / JupyterLab extension:
82+
- Reads the injected `REANA_ACCESS_TOKEN` environment variable on request.
83+
- Uses this token for all API calls to the REANA server.
84+
85+
CLI (`reana-client`):
86+
- Loads the token from the REANA config file written at spawn (or later replaced by running `reana-client auth`, which performs an OAuth 2.0 device flow and rewrites the stored token).
87+
- Uses this token for CLI commands.
88+
89+
:::tip[Future considerations]
90+
```
91+
Authentication improvements:
92+
93+
- Store refresh tokens in the environment and use them to obtain new access tokens when the current one expires.
94+
- Ensure shorter expiry times for access tokens to enhance security.
95+
- Implement mechanism that ensure the CLI and UI are always using the same, latest access token.
96+
```
97+
:::
214 KB
Loading

0 commit comments

Comments
 (0)