This services provides login and logout endpoints for a particular domain name. It also
This service provides two endpoints relative to the authentication of a user:
* A login endpoint that will allow a user to authenticate itself using its credentials (a username and an encrypted password). When the credentials are correct it will generate a JSON Web Token and set it as a cookie for the domain name specified in the configuration of the service. An xsrf token will also be returned in the response. Both the cookie and the xsrf token will be needed to make authenticated calls later.
* A logout endpoint, which signs out the user by deprecating the cookie set with the login endpoint.
This service also provides endpoints to retrieve and update a user profile.
The entrypoint of the service is a REST API provided by a [NestJS](https://github.com/nestjs/nest) application. It depends on two other services:
* The Legacy Authentication Middleware to verify the identity of the user and retrieve its profile (called through our api gateway: Kong)
* The Admin API of Kong to get the user specific secrets in order to sign the JSON Web Tokens
## API documentation
## API documentation
NestJS provides a swagger module that can be easily integrated. Using specific annotations alongside your endpoints declaration, this module will automatically generates a swagger documentation, reachable at `/api-docs`.
NestJS provides a swagger module that can be easily integrated. Using specific annotations alongside your endpoints declaration, this module will automatically generates a swagger documentation, reachable at `/api-docs`.