POST api/auth/login

API thực hiện đăng nhập và trả về token trong trường hợp đăng nhập thành công.

Request Information

URI Parameters

None.

Body Parameters

Thông tin đăng nhập bao gồm tên người dùng và mật khẩu.

LoginModel
NameDescriptionTypeAdditional information
Username

Tên người dùng hoặc địa chỉ email để đăng nhập.

string

None.

Password

Mật khẩu của người dùng.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "Username": "sample string 1",
  "Password": "sample string 2"
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'LoginModel'.

Response Information

Resource Description

Token JWT nếu đăng nhập thành công, hoặc Unauthorized nếu thất bại.

IHttpActionResult

None.

Response Formats

application/json, text/json

Sample:

Sample not available.