# Enroll

The objective of this repo is to provide guidance on how to enroll in the EMERALD project, or any other project that uses git.code.tecnalia.com as a repository.

In order to enroll a project such as EMERALD, you need to follow the next steps:

1. [Register in git.code.tecnalia.com with orein.](#register-in-gitcodetecnaliacom-with-orein)
2. [Login to git.code.tecnalia.com](#Login-to-gitcodetecnalia.com)
3. [Request access to the project responsible](#Request-access-to-the-project-responsible)

We included a section for [trouble shooting](#trouble-shooting) in case of sign-up or sign-in issues.

## Register in gitcodetecnaliacom with orein
First of all you have to create an account in git.code.tecnalia.com so that you can be added latter to a project. In order to create an account:

* Access to Orein
* Register account
* Activate 2fa
    * Activate authenticator
    * Copy recovery codes
* Confirm email
* Login

To log in go to the root url of the gitlab repository [htts://git.code.tecnalia.com/](https://git.code.tecnalia.com/) as an external user or click `Sign in` if you are in another page ( i.e. https://git.code.tecnalia.com/groups/emerald ).

![Anonym access](.media/image01.png){width=80%}

In both ways you will reach the login page. 

![Anonym login page](.media/image02.png){width=50%}

There you have three options to log in:
* LDAP
* Standard
* Orein OpenID

As an external user you have to use the Orein OpenID option. Click on the Orein OpenID button and you will be redirected to the Orein login page.

![Orein login page](.media/image03.png){width=50%}

Orein login page offers different options.
1. Register an account on orein
2. Login with an active account on orein
3. Use an identity provider as
    * github
    * Google
    * Microsoft
    * Amazon
4. Use a [FIDO2](https://fidoalliance.org/fido2/)
5. Use a Tecnalia account
6. And reocover the orein account password if you have forgotten it.

External users can use the first four options. wW will address the registering process in this guide. Click on the `Register (1)` button. 

![Register Page](.media/image04.png){width=80%}

To register we require email and password with some complexity.

![Password Complexity](.media/image05.png){width=80%}

Immediately, you are going to be asked to configure the `2FA` two factor authentication. Which is mandatory for all users in git.code.tecnalia.com.

![2FA](.media/image06.png){width=80%}

Following the instructions you should configure your Authenticator app. In this case we show the process with the [Microsoft Authenticator](https://play.google.com/store/apps/details?id=com.azure.authenticator&hl=es&gl=US) app. But you can use any other app that supports the TOTP protocol such as [Google Authenticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=es&gl=US) or [Authy](https://play.google.com/store/apps/details?id=com.authy.authy&hl=es&gl=US).

![MSAutheticator01](.media/image07.png){width=175}![MSAutheticator02](.media/image08.png){width=175}![MSAutheticator03](.media/image09.png){width=175}![MSAutheticator04](.media/image10.png){width=175}![MSAutheticator05](.media/image11.png){width=175}![MSAutheticator06](.media/image12.png){width=175}

That number should be used to confirm the 2FA configuration.

![2FA comfirm code](.media/image13.png){width=80%}

Once validated the 2FA you will be shown the recovery codes. 

![Recovery code](.media/image14.png){width=80%}

**Important**: **Copy Authentication recovery codes** in a secure place. These are required in case you lost the authenticator. The can be also used to login in case you have forgotten the password and you need to reset it.

![2FA Configured](.media/image15.png){width=80%}
Comfirm email (Beware of spam)

![Comfirm email](.media/image16.png){width=60%}
![Confirmation page](.media/image17.png){width=80%}
![Spam](.media/image18.png){width=80%}

## Login to git.code.tecnalia.com

To login using orein you have to click on the Orein OpenID button and you will be redirected to the Orein login page. There you have to use the first (2) option. The number 2 in the image below.

![Orein login page](.media/image03.png){width=50%}

To login

![Orein login page with data](.media/image19.png)
![2FA request](.media/image20.png)

That will drive you to the welcome page or the group page where you have clicked the login button.

![Welcome page](.media/image21.png){width=80%}

## Request access to the project responsible

There are two ways to request access to the project.
- Send an email to a [project owner](https://git.code.tecnalia.com/groups/emerald/-/group_members)
- Once you are logged in you can request access. Clicking the request access button.

![Request Access](.media/image22.png){width=80%}

## Trouble shooting

In case of sign-up or sign-in issues you can contact project owners https://git.code.tecnalia.com/groups/emerald/-/group_members at tecnalia. These are some of the common issues and how to solve them.

- [Lost of Authenticator](#lost-of-authenticator)
- [Lost of the recovery codes](#lost-of-the-recovery-codes)
- [Lost of the password](#lost-of-the-password)
- [Lost of authenticator and recovery codes](#lost-of-authenticator-and-recovery-codes)


### Lost of Authenticator

In case you have lost the authenticator access your configuration page in orein.

![Orein login page with data](.media/image19.png){width=50%}

After login you can be asked for the 2FA code. Use a recovery code as you have not the authenticator.

![2FA request](.media/image20.png){width=50%}

Once you are in

![Welcome to gitlab](.media/image24.png){width=50%}

Go to the [account](https://git.code.tecnalia.com/-/profile/account) section in the profile menu.

![Profile account](.media/image25.png){width=50%}

The configuration page you that bring you to the [2FA configuration](https://git.code.tecnalia.com/-/profile/two_factor_auth).

![2FA configuration](.media/image26.png){width=50%}

In this case as described in the `Register a one-time password authenticator`you have to first to `Disable two-factor authentication` (1) and then register again.

![2FA](.media/image06.png){width=50%}

Following the procedure shown in the [register in git.code.tecnalia.com with orein.](#register-in-gitcodetecnaliacom-with-orein) section. Do not forget to take note of the recovery codes.

![2FA Success](.media/image27.png){width=50%}

### Lost of the recovery codes

In case you have lost the recovery codes you can recover them from the the [2FA configuration](https://git.code.tecnalia.com/-/profile/two_factor_auth). 

![2FA configuration](.media/image26.png){width=50%}

There you can `Regenerate recovery codes` (2) to create a new set of recovery codes.

### Lost of the password

In case you have lost the password you can reconfigure it from the Orein login page.

![Orein login page](.media/image03.png){width=50%}

In this case you have to click on the `Forgot your password?` (6) link. This will request your email.

![Request password recovery](.media/image28.png){width=80%}

![Forgot Password Confirmation](.media/image29.png){width=80%}

You will receive an email with a link to reset the password.

![Reset mail](.media/image30.png){width=80%}

After you click on the link `here` you will be asked to set a new password.

![Forward change form](.media/image31.png){width=80%}

From there, your request can be directly accepted.

![Forward change form](.media/image32.png){width=80%}

From there, you will be forwarded to the login page. After login you can be asked for the 2FA code. In case you have lost the authenticator you can use the recovery codes.

![2FA code request](.media/image33.png){width=80%}


### Lost of authenticator and recovery codes

In case you have lost the authenticator and the recovery codes you can request a `2FA reset` to your account by contacting the [project owner](https://git.code.tecnalia.com/groups/emerald/-/group_members) at tecnalia.