---
title: "Login (Realtime)"
slug: "login-realtime"
updated: 2026-05-14T21:42:36Z
published: 2026-05-14T21:42:36Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Login (Realtime)

![](https://cdn.us.document360.io/27ca1fd4-36d7-4cde-b4eb-97fc1652954c/Images/Documentation/Deprecated.svg)

Rocket.Chat supports various methods of authentication. The list of supported auth services (and their configurations) are in the `meteor_accounts_loginServiceConfiguration` collection.

## Use username and password

To ensure the security of the user's account, it is important not to submit the user's password as plain text. Instead, apply a hashing algorithm (***for example - sha-256***).

> [!NOTE]
> The digest must be lowercase.

### Payload parameters

| Argument | Example | Required | Description |
| --- | --- | --- | --- |
| `user` | `{ "username": "doe.jon" }` | Required | The user object containing either the username or email. |
| `password` | `{ “digest”: “79cos9ejfs9j”, “algorithm”: “sha-256” }` | Required | The password object containing the hashed password and the hash algorithm. |

### Example Payload

```json
{
  "digest": "52c53f4abbfe42e1ccd4fd9d864453ee57f8efbd4c9ecec6d88bd83d7f7a9c02",
  "algorithm":"sha-256"
}
```

### Example call

```json
{
    "msg": "method",
    "method": "login",
    "id":"42",
    "params":[
        {
            "user": { "username": "him" },
            "password": {
                "digest": "52c53f4abbfe42e1ccd4fd9d864453ee57f8efbd4c9ecec6d88bd83d7f7a9c02",
                "algorithm":"sha-256"
            }
        }
    ]
}
```

### Example response

**Success**

```json
{
    "msg": "result",
    "id": "42",
    "result": {
        "id": "3Dw26TXWxvi8gwfgM",
        "token": "72kB2z5SpnWG-vOSKaAXku74PV851pVOVAoC67FpFEI",
        "tokenExpires": {
            "$date": 1696417505309
        },
        "type": "password"
    }
}
```

**Error**

```json
{
    "msg": "result",
    "id": "42",
    "error": {
        "error": 403,
        "reason": "Incorrect password",
        "message": "Incorrect password [403]",
        "errorType": "Meteor.Error"
    }
}
```

## Use an authentication token

You can use a previous user authentication token or a [Personal Access Token](https://docs.rocket.chat/docs/manage-personal-access-tokens) to log in as a user.

### Payload parameters

| Argument | Example | Required | Description |
| --- | --- | --- | --- |
| `resume` | `5BwhTeEXiTmU_8uKxGuy4pqWRHRP73QpJYmoSWfBpc` | Required | A personal access token or previous authToken of the user. |

### Example call

```json
{
    "msg": "method",
    "method": "login",
    "id": "42",
    "params":[
        { "resume": "auth-token" }
    ]
}
```

### Example response

> [!NOTE]
> This success response format remains the same irrespective of the login method used.

```json
{
    "msg": "result",
    "id": "42",
    "result": {
        "id": "LFdhbcNHx5zsMA7T4",
        "token": "5BwhTeEXiTmU_8uKxGuy4pqWRHRP73QpJYmoSWfBpcB",
        "tokenExpires": {
            "$date": 1696418806422
        },
        "type": "resume"
    }
}
```

> [!NOTE]
> If the `auth-token` is expired, send another login request to get a new `authToken` with a new expiration date.

## Use authentication providers

OAuth is used to support additional auth providers.

### Example call

```json
{
    "msg": "method",
    "method": "login",
    "id":"42",
    "params": [
        {
            "oauth": {
                "credentialToken":"credential-token",
                "credentialSecret":"credential-secret"
            }
        }
    ]
}
```
