Lattice Hub Docs
HTTP OpenAPIAuthentication

Login & status

User login and auth system status.

User login and auth system status. See sibling pages for users, groups, roles, and policies.

Default Base URL: http://127.0.0.1:8090. Management APIs require Authorization (token from login).

Auth · Login

Login and auth system status.

POST/auth/v1/user/login

User login

Exchange credentials for a management token; later calls send Authorization. Body is LoginRequest.

  • ownerbody · stringoptional

    owner

  • namebody · stringrequired

    name

  • passwordbody · stringrequired

    password

  • optionsbody · map<string,string>optional

    options

  • codebody · uint32required

    Business code; success is usually 200000.

  • infobody · stringoptional

    Info message.

  • loginRequestbody · LoginRequestoptional

    LoginRequest entity fields (batch APIs nest under responses[]).

    • ownerbody · stringoptional

      owner

    • namebody · stringoptional

      name

    • passwordbody · stringoptional

      password

    • optionsbody · map<string,string>optional

      options

Request
curl -sS -X POST 'http://127.0.0.1:8090/auth/v1/user/login' \
  -H 'Content-Type: application/json' \
  -d '{"name":"admin","password":"Pole@123456"}'
Response example
{
  "code": 200000,
  "info": "execute success",
  "loginResponse": { "user_id": "xxx", "token": "<token>", "name": "admin" }
}
GET/auth/v1/system

Auth system status

Check whether auth is enabled and the main user exists.

No parameters.

Request
curl -sS 'http://127.0.0.1:8090/auth/v1/system'
Response example
{
  "code": 200000,
  "info": "execute success",
  "option": { "authEnabled": "true", "mainUserExist": "true" }
}

On this page