-
Notifications
You must be signed in to change notification settings - Fork 0
Authentification API
Liam Boudadi edited this page Feb 6, 2025
·
13 revisions
POST /change-password (update the user's password associated with the JWT)
None
http code content-type response 200stringPassword changed successfully400stringNew password does not meet security requirements401stringCurrent password is incorrect404stringUser not found
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)
name type data type description required int The specific user email
http code content-type response 200stringPassword reset successfully404stringUser not found500stringError sending email
curl -L -X POST 'http://localhost:8080/authenticate/reset-password?{email}' -H 'Authorization: Bearer {JWT}'
GET /need-change-password (return true if the user associated with the JWT needs to change his password, false otherwise)
None
http code content-type response 200stringTrue or False404stringUser not found
curl -L -X GET 'http://localhost:8080/authenticate/need-change-password' -H 'Authorization: Bearer {JWT}'
POST /delete-user?{email} (delete the request user)
ADMIN
name type data type description required string The specific user email
http code content-type response 200stringUser deleted successfully404stringUser not found
curl -L -X POST 'http://localhost:8080/authenticate/delete-user?{email}' -H 'Authorization: Bearer {JWT}'
GET /export-users (export users in csv file)
ADMIN
None
http code content-type response 200csvUsers' info500stringError exporting users: {error message}
curl -L -X GET 'http://localhost:8080/authenticate/export-users' -H 'Authorization: Bearer {JWT}'
POST /register (register a new user)
ADMIN
None
http code content-type response 200stringUser registered successfully409stringUser already exists500stringError sending email
curl -L -X POST 'http://localhost:8080/authenticate/register' -H 'Authorization: Bearer {JWT}' --body-raw "{'firstName': {string}, 'lastName': {string}, 'email': {string}, 'position': {string}, 'role': {ADMIN or USER}}"
GET /get-user (return the user's infos associated with the JWT)
None
http code content-type response 200json{"id": {int}, "firstName": {string}, "lastName": {string}, "email": {string}, "position": {string}, "role": {ADMIN or USER}}404stringUser not found
curl -L -X GET 'http://localhost:8080/authenticate/get-user' -H 'Authorization: Bearer {JWT}'
GET /{formationId} (gets details about the formation requested)
name type data type description formationId required int The specific formation id
http code content-type response 200json{"id": {int}, "name": {string}, "description": {string}}404N/A
curl -L -X GET 'http://localhost:8080/formation/{formationId}' -H 'Authorization: Bearer {jwt}'