Open iyannsch opened 5 months ago
JWT is not built to generate additional tokens seamlessly.
I do not agree with this statement. Users can login on multiple browsers, each time a new JWT token is generated. So in some sense, you could argue that one user can have arbitrary many JWT tokens at the same time.
The Artemis client / browser stores the token in the cookie so that links to attachments can be shared and opened in separate tabs without the web application being active.
However, this mechanism is not set in stone. If there is a specific requirement to change it, we can discuss it.
Another alternative would be to host the client part of the Online IDE using the same URL as the Artemis instance based on a micro frontend approach. Then, the online IDE could directly access the JWT token within the cookie.
Feature Proposal
Context
Problem
The student needs to be authenticated when using the online IDE. Especially for the exam mode, it is important that the user is not able to share his session link with someone else so that this person works in his place and attempts cheating. The VSCode plugin inside of the Online IDE needs an authentication token to access the problem statement and other components of the Artemis website. Two problems therefore arise:
In addition, we don't want another login process where the user has to enter his credentials again. Opening the online IDE should be seamless and provide a fast entry.
The git cloning via HTTP or SSH imposes a secondary problem. The Theia session has to be able to clone and push to the student's exercise repository. If we clone the repository with HTTP the user would have to enter his credentials again. For SSH, we would have to generate an SSH on each Online Session start-up and link its public key to Artemis.
Motivation
Requirements Engineering
Existing (Problematic) Solution / System
Currently, Artemis uses JWT to authenticate its user. The JWT token is stored as an HTTPOnly cookie and can not be read in JS. Even if it were not HTTPOnly, hijacking that token would not be good practice, as a token should only be used for one service and not be shared. Therefore a new token for the online IDE and for the plugin should be generated. JWT is not built to generate additional tokens seamlessly.
Proposed System
To protect a theia session and guarantee seamless authentication we would integrate OIDC into Artemis. This allows generating a new token on session start up. Authentication users with OIDC before granting them session access generates traces at the KeyCloak OID-Provider allowing fraud detection just like the existing session monitoring
With OIDC:
For the cloning of repositories we propose a token based cloning. Theia would then be provided with such a token and the user would not have to enter his credentials again. Open:
Requirements
Analysis
Analysis Object Model
Dynamic Behavior
System Architecture
Subsystem Decomposition
Persistent Data Management
Access Control / Security Aspects
Other Design Decisions
UI/UX Design
Open to discuss