From 3b08a66720629f39dda56af98d372fbb065ca2da Mon Sep 17 00:00:00 2001 From: FORESTIER Fabien <fabien.forestier@soprasteria.com> Date: Mon, 3 Jun 2019 17:22:11 +0200 Subject: [PATCH] Update authentication service 'What it does' and 'how it works' sections --- architecture/services/authentication.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/architecture/services/authentication.md b/architecture/services/authentication.md index b481c23..a2943c2 100644 --- a/architecture/services/authentication.md +++ b/architecture/services/authentication.md @@ -3,12 +3,23 @@ ## 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  +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 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`. -- GitLab