Skip to content

Authentification API

Liam Boudadi edited this page Feb 6, 2025 · 13 revisions

Listing existing formations, quizzes and videos

POST /change-password (change the user's password)

Parameters

None

Responses

http code content-type response
200 string Password changed successfully
400 string New password does not meet security requirements
401 string Current password is incorrect
404 string User not found

Example cURL

 curl -L -X POST 'http://localhost:8080/authenticate/change-password' -H 'Authorization: Bearer {jwt}' --data-raw "{"currentPassword": {string}, "newPassword": {string}}"
POST /reset-password?{email} (reset the requested user password)

Parameters

name type data type description
email required int The specific user email

Responses

http code content-type response
200 string Password reset successfully
404 string User not found
500 string Error sending email

Example cURL

 curl -L -X POST 'http://localhost:8080/authenticate/reset-password?{email}' -H 'Authorization: Bearer {jwt}' 
GET /need-change-password (return true if the current user needs to change his password, false otherwise)

Parameters

None

Responses

http code content-type response
200 string True or False
404 string User not found

Example cURL

 curl -L -X GET 'http://localhost:8080/authenticate/need-change-password' -H 'Authorization: Bearer {jwt}'
POST /delete-user?{email} (delete the request user)

Allowed roles

ADMIN

Parameters

name type data type description
email required string The specific user email

Responses

http code content-type response
200 string User deleted successfully
404 string User not found

Example cURL

 curl -L -X POST 'http://localhost:8080/authenticate/delete-user?{email}' -H 'Authorization: Bearer {jwt}'
GET /export-users (export users in csv file)

Allowed roles

ADMIN

Parameters

None

Responses

http code content-type response
200 csv Users' info
500 string Error exporting users: {error message}

Example cURL

 curl -L -X GET 'http://localhost:8080/authenticate/export-users' -H 'Authorization: Bearer {jwt}'
GET /register (register a new user)

Allowed roles

ADMIN

Parameters

None

Responses

http code content-type response
200 string User registered successfully
409 string User already exists
500 string Error sending email

Example cURL

 curl -L -X POST 'http://localhost:8080/authenticate/register' -H 'Authorization: Bearer {jwt}' --body-raw
GET /{formationId} (gets details about the formation requested)

Parameters

name type data type description
formationId required int The specific formation id

Responses

http code content-type response
200 json {"id": {int}, "name": {string}, "description": {string}}
404 N/A

Example cURL

 curl -L -X GET 'http://localhost:8080/formation/{formationId}' -H 'Authorization: Bearer {jwt}'

Clone this wiki locally