diff --git a/Wiki/UserDocumentation/1-Authentification.md b/Wiki/UserDocumentation/1-Authentification.md index 8b1f285d7df035ef9c8eb78da4dba8f26708d69b..aab265ae68f322e9bb9a5c30e6aac11bb8ec3a78 100644 --- a/Wiki/UserDocumentation/1-Authentification.md +++ b/Wiki/UserDocumentation/1-Authentification.md @@ -1,38 +1,44 @@ # Authentication to the Dojo -The authentication is done in two steps: login into the dojo app and into https://gitedu.hesge.ch (through an API token). - -1. Login into the dojo application: +The authentication is done by the login command: ```bash -dojo session application login --user <email> +dojo session login ``` ```console -? Please enter your password [hidden] -Please wait while we are logging in you to Dojo... -✔ Logged in - ✔ Teaching staff permissions - ✔ Student permissions +Please wait while we login you into Dojo... +ℹ Login with Gitlab (https://gitedu.hesge.ch/): + ✔ Login server started + ⠇ Waiting for user to authorize the application in his web browser ``` +At this time the cli opens a web browser to the Gitlab login page. Once you are logged in you will be asked to authorize the application to access your account. Click on the `Authorize` button. -2. Register the API token (see below) for Gitlab -```bash -dojo session gitlab login <token> -``` + + +**Note:** If you want to use the cli in a headless environment you can use the `--cli` option. In this case you will be provided with a link to copy/paste in your browser. + +Once, the authorization is done, the cli will retrieve the Gitlab token and will try to login to the Dojo backend. If everything is ok you will see the following output: ```console -Please wait while we are testing your Gitlab token... -ℹ Checking Gitlab token: +Please wait while we login you into Dojo... +ℹ Login with Gitlab (https://gitedu.hesge.ch/): + ✔ Login server started + ✔ Login code received + ✔ Login server stopped + ✔ Gitlab tokens retrieved +ℹ Checking Gitlab token: ✔ Read access ✔ Write access +ℹ Login to Dojo backend: + ✔ Logged in +ℹ Checking Dojo session: + ✔ The session is valid + ✔ Student permissions + ✔ Teaching staff permissions + ✔ Admin permissions ``` -The API token can be created by (see <https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html> for more informations): -- Logging into <https://gitedu.hesge.ch> -- **Preferences -> Access Tokens** -- Give a name to your token and a validity -- Tick the **api** box -- Click the **Create personal access token** -3. Test if it is working + +## Test if it is working ```bash dojo session test ``` diff --git a/Wiki/figures/GitlabLogin.png b/Wiki/figures/GitlabLogin.png new file mode 100644 index 0000000000000000000000000000000000000000..bfa99cde6a3fbe64055f0b1f6c9aa39b9f8528fa Binary files /dev/null and b/Wiki/figures/GitlabLogin.png differ