Login with Username and Password
    • Dark
      Light
    • PDF

    Login with Username and Password

    • Dark
      Light
    • PDF

    Article summary

    Post
    /api/v1/login
    • Although none of the body parameters are required, it's mandatory to include either the user AND password or only the resume parameter.

    • To authenticate a request, you need to pass the userId and authToken values from this JSON response object as headers in the request. The authToken is passed as X-Auth-Token header, while the userId as X-User-Id header.

    • If LDAP authentication is enabled, you must maintain the login in the same way as you normally do. Similarly, if 2FA is enabled for an LDAP user, everything stays the same.

    Changelog

    VersionDescription
    1.0.0Added avatarUrl property to response
    0.64.0Added me property.
    0.60.0Added
    Body parameters
    Example
    {
      "user": "[email protected]",
      "password": "vanvica32"
    }
    object
    user
    string

    Your user name or email.

    Examplemyusername
    password
    string

    Your pasword.

    Examplemy$up3erP@ssw0rd
    resume
    string

    Your previously issued authToken.

    Example9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq
    code
    string

    The 2FA code. It is required if your account has two-factor authentication enabled .

    Example2246d10
    Responses
    200
    Login successful
    {
      "status": "success",
      "data": {
        "authToken": "9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq",
        "userId": "aobEdbYhXfu5hkeqG",
        "me": {
          "_id": "aYjNnig8BEAWeQzMh",
          "name": "Rocket Cat",
          "emails": [
            {
              "address": "[email protected]",
              "verified": false
            }
          ],
          "status": "offline",
          "statusConnection": "offline",
          "username": "rocket.cat",
          "utcOffset": -3,
          "active": true,
          "roles": [
            "admin"
          ],
          "settings": {
            "preferences": {}
          },
          "avatarUrl": "http://localhost:3000/avatar/test"
        }
      }
    }
    Expand All
    object
    status
    string
    data
    object
    authToken
    string
    userId
    string
    me
    object
    _id
    string
    name
    string
    emails
    Array of object
    object
    address
    string
    verified
    boolean
    status
    string
    statusConnection
    string
    username
    string
    utcOffset
    integer
    active
    boolean
    roles
    Array of string
    string
    settings
    object
    preferences
    object
    avatarUrl
    string

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.