POST api/Auth/LongLivedToken

Generates a long-lived token for a user based on the provided credentials and validity duration.

Request Information

URI Parameters

None.

Body Parameters

The request containing the username, password, and desired number of validity days.

LongLivedTokenRequest
Name Description Type Additional information
Username

string

None.

Password

string

None.

Days

integer

None.

Request Formats

application/json, text/json

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

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.

Response Information

Resource Description

An HTTP response containing the long-lived token if authentication succeeds; otherwise, an error response indicating the reason for failure.

IHttpActionResult

None.

Response Formats

application/json, text/json

Sample:

Sample not available.

application/bson

Sample:
Binary JSON content. See http://bsonspec.org for details.