The server responsible for handling Focus authentication
In order to run the server you'll need the following tools :
git clone https://github.com/FocusCompany/authentication-server.git
cd authentication-server
docker-compose -f compose-<prod|dev>.yml up -d
/api/v1/
You have to provide this 4 parameters to register a new user
- first_name: (ex. Etienne)
- last_name: (ex. Pasteur)
- email: (ex. [email protected])
- password: (ex. toto42sh)
Expected return :
{
"message": "User successfully created"
}
You have to provide this an email and a password in parameters to login (optionally you can provide a device_id to authenticate a device)
- email: (ex. [email protected]) required
- password: (ex. toto42sh) required
- device_id: (ex. 23) optional
Expected return :
{
"message": "Success",
"token": "..."
}
You have to provide this parameter to renew your JWT token
- token: (ex. eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9........)
Expected return :
{
"message": "Success",
"token": "..."
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header
Expected return :
{
"message": "Success the token have been deleted"
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header
Expected return :
{
"message": "Success all the token have been deleted"
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- password: (ex. toto42sh)
Expected return :
{
"message": "Success user and his data have been deleted"
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this optional parameters
- first_name: (ex. Etienne) optional
- last_name: (ex. Pasteur) optional
- email: (ex. [email protected]) optional
- new_password: (ex. focus42sh) optional
- password: (ex. toto42sh) required
Expected return :
{
"message": "User updated"
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header
Expected return :
{
"code": "SUCCESS",
"message": "Successfully get info ",
"devices": [
{
"id_devices": 1,
"devices_name": "MacBook Pro de Etienne",
"is_deleted": 0,
"users_uuid": "66ccfbd9-8844-4370-a517-80646dad3820",
"collections": [
{
"id_collections": 3,
"collections_name": "HOME"
},
{
"id_collections": 4,
"collections_name": "WORK"
}
]
},
{
"id_devices": 2,
"devices_name": "Test",
"is_deleted": 0,
"users_uuid": "66ccfbd9-8844-4370-a517-80646dad3820",
"collections": []
}
]
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- devices_name: (ex. MacBook Pro de Etienne)
Expected return :
{
"message": "Success the device has been registered",
"deviceId": 1
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- device_id: (ex. 1)
- keep_data: (ex. true/false)
Expected return :
{
"message": "Device deleted, Data deleted/kept"
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- collections_name: (ex. HOME)
Expected return :
{
"message": "Success the group has been created",
"groupId": 1
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- collections_name: (ex. HOME)
Expected return :
{
"message": "Group deleted"
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header
Expected return :
{
"code": "SUCCESS",
"message": "Success",
"collections": [
{
"id_collections": 3,
"collections_name": "HOME"
},
{
"id_collections": 4,
"collections_name": "WORK"
}
]
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- collections_name: (ex. HOME)
- device_id: (ex. 1)
Expected return :
{
"message": "Success the device has been added to group",
"deviceId": 1,
"collectionId": 1
}
You have to provide a JWT token inside the Bearer Token
in the Authorization Header and this parameter
- collections_name: (ex. HOME)
- device_id: (ex. 1)
Expected return :
{
"message": "Device deleted from group"
}
MISSING_PARAMETERS: "MISSING_PARAMETERS",
WRONG_PARAMETERS: "WRONG_PARAMETERS",
ALREADY_REGISTERED: "ALREADY_REGISTERED",
DATABASE_ERROR: "DATABASE_ERROR",
SUCCESS: "SUCCESS"