Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/extensions/reana-jupyterlab/usage/authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Authentication

## Token Reuse

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
The REANA JupyterLab extension automatically reuses the existing JWT access token issued by the IdP, corresponding to the one that authenticated the current JupyterLab session. **No additional login or authentication steps are required** to start using REANA through the extension.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unsure how to mention that the token is VRE requested. The VRE initiates the token request itself, hence I have mentioned like this, but I can see that it is incorrect. I will change it to your suggestion

Copy link
Contributor

@Soap2G Soap2G Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! "VRE-issued" it's definitely NOT incorrect (in a sense it is true), but in the perspective of having this documentation usable by a broader audience than the VRE one, I think it's better to generalise the fact that it doesn't matter the token provenance, the only important thing is that it's a valid token :)


## Verifying Access

You can verify that authentication is working properly by:

1. Opening the REANA sidebar tab in JupyterLab
2. Checking if you can see your workflows listed
3. Opening a workflow detail panel to see its contents

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the unauthorized feature developed and implemented ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "unauthorized" message is my assumption for an error message that could appear if something goes wrong.
This PR contains documentation about multiple things that have not been developed and implemented, and I had to assume and think through some of the issues/challenges that may arise. Do you think it could be useful to make the docs more abstract and this paragraph to avoid specific values?


## Troubleshooting

If you encounter authentication problems:

- **Token expired?** Restart your JupyterLab container to get a fresh token
- **Still not working?** Re-login to the VRE web interface, then launch a new JupyterLab session
- **Need different credentials?** Use the connection configuration panel (see below)

## Optional Connection Configuration

You can manually configure the connection to a different REANA instance by:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can manually configure the connection to a different REANA instance by:
You can still manually configure the connection to a different REANA instance by:


1. Opening the REANA sidebar tab
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Open Reana JupyterLab by clicking on the REANA icon in the JupyterLab sidebar.

2. Clicking on the connection settings icon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click

3. Entering a custom server URL and/or access token
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. Entering a custom server URL and/or access token
3. Entering a custom server URL and access token


This is useful if you need to connect to a different REANA instance than the default one configured for VRE.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence doesn't add any relevant information.

Please change it with the last paragraph of the page you removed:

After connecting to the REANA server, a notification will appear in the bottom right corner of the screen indicating that the connection was successful. You can now interact with the REANA server from within JupyterLab.


## Authentication Flow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this section upper, so that we get the following order

  • Verifying Access
  • Authentication flow
  • Troubleshooting
  • Optional Connection Configuration


![Authentication Flow](../../../../static/img/reana-extension-auth-flow.png)

*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.*
11 changes: 0 additions & 11 deletions docs/extensions/reana-jupyterlab/usage/connection.md

This file was deleted.

24 changes: 23 additions & 1 deletion docs/reana.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ Explore Reana on the software's [official documentation](https://docs.reana.io/)

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

# Authentication with reana-client

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a link for oauth2.0 so that people can educate themselves, for example
https://auth0.com/intro-to-iam/what-is-oauth-2
or https://oauth.net/2/
(I prefer first link, more user-friendly. Thoughts @Soap2G)


```bash
$ reana-client auth
```

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.

Example output:

```text
$ reana-client auth
Go to: https://iam-escape.cloud.cnaf.infn.it/device
Enter code: 4HAL4G
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change 4HAL4G with ********, also below.

Or open: https://iam-escape.cloud.cnaf.infn.it/device?user_code=4HAL4G
Waiting for authorization...
```

> **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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> **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.
:::warning[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.
:::

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please have a look at https://github.com/vre-hub/vre-hub.github.io/actions/runs/16969223016/job/48101346774?pr=35

Just ping if you need any Docusaurus related help


# Reana - Rucio integration

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.
Expand Down Expand Up @@ -92,4 +114,4 @@ $ reana-client upload
$ reana-client start
$ reana-client status
```
5. Check the state of your workflow on https://reana-vre.cern.ch/.
5. Check the state of your workflow on https://reana-vre.cern.ch/.
30 changes: 30 additions & 0 deletions docs/tech-docs/services/computing-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,33 @@ kubectl exec -i -t deployment/reana-server -n reana -- flask reana-admin token-g

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

## JupyterLab REANA Extension Authentication

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user friendly explanatory link for JWT too, please.


### Token injection at spawn time
During user pod creation the VRE spawner:
- Obtains (or reuses) the user's already validated access token.
- Injects it as an environment variable (`REANA_ACCESS_TOKEN`).
- Writes a lightweight config file with the token for `reana-client` CLI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a point at the end of the sentence, please


No refresh token is stored; only the short‑lived access token is passed.

### Token storage (UI extension vs CLI)
UI / JupyterLab extension:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
UI / JupyterLab extension:
The UI / JupyterLab extension:

- Reads the injected `REANA_ACCESS_TOKEN` environment variable on request.
- Uses this token for all API calls to the REANA server.

CLI (`reana-client`):
- 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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change it with written "during the spawning of the user session"

- Uses this token for CLI commands.

:::tip[Future considerations]
```
Authentication improvements:

- Store refresh tokens in the environment and use them to obtain new access tokens when the current one expires.
- Ensure shorter expiry times for access tokens to enhance security.
- Implement mechanism that ensure the CLI and UI are always using the same, latest access token.
```
:::
Binary file added static/img/reana-extension-auth-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading