Skip to main content
POST
/
login
Login.
curl --request POST \
  --url https://lab.trustos.telefonicatech.com/id/v2/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "did:user:<id>",
  "password": "password"
}
'
{
  "statusCode": 200,
  "message": "Login",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e"
  }
}
The API has a token expiration mechanism in place, where the period of validity of the issued JSON Web Token (JWT) is currently set to 30 minutes. After this time, the JWT will no longer be valid and the user will need to either call the “/refresh” method or log in again to obtain a new valid JWT. This ensures the security of the user’s session and minimizes the risk of unauthorised access to their account.

Body

application/json

Data needed for the login.

username
string
required

The user's did.

Example:

"did:user:<id>"

password
string
required

The user's password.

Example:

"password"

Response

Successful login.

statusCode
number

Request status code.

Example:

200

message
string

Message returned by the request.

Example:

"Login"

data
object

Data returned by the request.