This repository was archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
User login
Michał B edited this page Nov 11, 2018
·
1 revision
- Available at URI:
http://localhost:5000/user-management/users/token - Type of success response:
200 OK with user token - Type of error response:
400 with error message - HTTP method type:
POST
- The data is sent in JSON format.
- Request body consists of:
-
loginOrEmail:
ulongrepresenting the login or email hash, parsed to thestringformat -
password:
ulongrepresenting the password hash, parsed to thestringformat
-
loginOrEmail:
Example of the valid JSON request body:
{
"loginOrEmail": "1231111111110056400",
"password": "1111112312456789456"
}- If all data in JSON request are valid and user exists in the database, then WebAPI returns
200 OKwith user token:
eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiI4Iiwicm9sZSI6InVzZXIiL
CJuYmYiOjE1MzM5NTUwOTgsImV4cCI6MTUzNDEyNzg5OCwiaWF0IjoxNTMzOTU1MDk4LCJpc3M
iOiJodHRwOi8vbG9jYWxob3N0OjUwMDAifQ.5gfXdxY90qsHXK25G4L81TS0PC8FTyaCBX55cF
tc8iabCfjW6J9AM827Q5Uwn1ati6mZ7knaJbKFVaWK63HQfA
It also returns headers like content type, date, server
- If data aren't valid or user doesn't exist, the WebAPI returns
400 Bad Requestwith error message.
For example, when the WebAPI receives not valid data:
{
"Password": [
"The length of 'Password' must be 20 characters or fewer. You entered 21 characters.",
"Invalid value!"
],
"LoginOrEmail": [
"The length of 'Login Or Email' must be 20 characters or fewer. You entered 21 characters.",
"Invalid value!"
]
}