From 7e63b2dc170cb5700b7dc65b771a63384060ab85 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 22 Feb 2021 12:59:33 +0100 Subject: [PATCH] update format, add additional informations --- docu/login_server.api.md | 57 ++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/docu/login_server.api.md b/docu/login_server.api.md index e97aff36b..c864456ba 100644 --- a/docu/login_server.api.md +++ b/docu/login_server.api.md @@ -24,33 +24,46 @@ Login Einloggen über: -# unsecureLogin +## unsecureLogin POST http://localhost/login_api/unsecureLogin ```json -data: {"username": "", "password": ""} +data: {"email": "max.musterman@gmail.de", "password": "123abcDE&"} ``` -Wenn alles okay ist erhältst du: +Wenn alles okay ist erhältst du zum Beispiel: ```json -{"state":"success", "session_id": , "clientIP":"", +{"state":"success", "session_id": -127182, "clientIP":"52.68.96.58", "user": { - "created": , - "disabled": , // login will fail if user is disabled - "email": "", - "email_checked": , // true if user has already clicked on email verification code link in his emails - "first_name": "", - "group_alias": "", - "ident_hash": , - "last_name": "", - "public_hex": "<64 character hex (contain only a-f and 0-9)>", - "role": "", // should be only valid for login-server - "username": "", - "balance": , // 174500 = 17,45 GDD - "id": , - "errorCount": + "created": 1293872400, + "disabled": false, + "email": "max.musterman@gmail.de", + "email_checked": true, + "first_name": "Max", + "group_alias": "gdd1", + "ident_hash": 1829912, + "public_hex": "c6e7d6a697fa74d6c247580edf1546989d43487575e21e398abe3cc2094bd63e", + "last_name": "Musterman", + "role": "none", + "username": "", + "balance": 174500, + "id": 1, + "errorCount": 0 }} ``` +- clientIP: should be the same as where the js-client is running, else maybe a man-in-the-middle attacks is happening or +nginx was wrong configured. +- session_id: can be also negative +- created: unix timestamp in seconds +- disabled: if set to true, login and every transaction must fail. Currently used if use would like to have there account deleted. +- email_checked: true if user has already clicked on email verification code link in his emails, needed for tranactions +- ident_hash: string hash from email, used for speed up creation validation +- public_hex: hexadecimal representation of 32 Byte public key of user [0-9a-f] +- role: not intended for future use, just ignore, login-server admin will be independently from community-server admin +- username: for later use +- balance: Gradido Cent, 4 Nachkommastellen (2 Reserve), 174500 = 17,45 GDD +- id: login-server user id, only needed for debugging +- errorCount: errors occured in this session, should be normally 0 Anmelden Registrieren kannst du einen neuen Benutzer mit: @@ -60,10 +73,14 @@ Registrieren kannst du einen neuen Benutzer mit: POST http://localhost/login_api/createUser ```json -data: {"email":"", "first_name":"", "last_name":"" , - "emailType": 2, "password":""} +data: {"email":"max.musterman@gmail.de", "first_name":"Max", "last_name":"Musterman" , + "emailType": 2, "password":"123abcDE&"} ``` +- emailType: control email-text sended with email verification code + - 2: default, if user has registered directly + - 5: if user was registered by an admin + Wenn alles okay ist erhältst du: ```json {"state":"success"}