Skip to content
Snippets Groups Projects
Commit 3b08a667 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Update authentication service 'What it does' and 'how it works' sections

parent 9942ce80
No related branches found
No related tags found
No related merge requests found
...@@ -3,12 +3,23 @@ ...@@ -3,12 +3,23 @@
## What it does ## What it does
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.
## How it works ## How it works
![authentication-service](/assets/authentication-service.png) ![authentication-service](/assets/authentication-service.png)
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`.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment