> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/l/lastpass.md).

# LastPass

|                             |                                  |
| --------------------------- | -------------------------------- |
| Category                    | Password manager                 |
| Asset types                 | Users                            |
| Authentication              | Company ID and provisioning hash |
| Direction                   | OctoXLabs → LastPass (read only) |
| Supported LastPass versions | Not specified                    |
| Available since             | Not specified                    |

LastPass is a password manager. OctoXLabs reads the users of your LastPass Business account from the Enterprise API and adds them to the user inventory.

## Use cases

* **Find LastPass admins.** List users that have the admin flag.

```
Adapters = lastpass AND AdminStatus = true
```

* **Find LastPass users with no directory account.** List LastPass users that are not found in Active Directory. How accounts are matched depends on your user merge settings.

```
Adapters = lastpass AND NOT Adapters = active-directory
```

## Before you begin

### Network

| Source              | Destination                  | Port | Protocol |
| ------------------- | ---------------------------- | ---- | -------- |
| OctoXLabs connector | lastpass.com (fixed address) | 443  | HTTPS    |

The connector calls `https://lastpass.com/enterpriseapi.php`. The host is fixed, so you do not enter an address. If a proxy is set, requests go through it.

### Required permissions

Not verified: the sources do not name a role. The baseline says you generate or copy the provisioning hash as an admin in the Admin Console.

## Create credentials in LastPass

{% stepper %}
{% step %}

### Sign in as an admin

Log in to the LastPass Admin Console as an admin.
{% endstep %}

{% step %}

### Open Enterprise API

Go to **Advanced Options > Enterprise API**.
{% endstep %}

{% step %}

### Copy the values

Copy the account number (CID) shown there, and generate or copy the **Provisioning Hash**.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter         | Required | Type    | Default | Description                                                                               |
| ----------------- | -------- | ------- | ------- | ----------------------------------------------------------------------------------------- |
| Company ID        | Yes      | String  | None    | Account number (CID) of your LastPass Business account, shown on the Enterprise API page. |
| Provisioning Hash | Yes      | String  | None    | Provisioning hash used to authenticate Enterprise API requests.                           |
| Proxy             | No       | String  | None    | Proxy address, for example `proxy.company.com:8080`.                                      |
| Timeout           | No       | Integer | 30      | Seconds to wait for an API response.                                                      |

## What the connection test does

The test sends a `getuserdata` request with a page size of 1. It fails when the API answers with status FAIL, and passes otherwise.

## API endpoints called

| Method | Path                                   | Purpose                                                                        |
| ------ | -------------------------------------- | ------------------------------------------------------------------------------ |
| POST   | /enterpriseapi.php (host lastpass.com) | Command `getuserdata` with `cid`, `provhash`, `pagesize` 2000 and `pageindex`. |

## Fields fetched

| LastPass field           | OctoXLabs field                               |
| ------------------------ | --------------------------------------------- |
| username                 | Username, Email (also the primary identifier) |
| Part of username after @ | Domain                                        |
| fullname                 | DisplayName                                   |
| created                  | CreatedTime                                   |
| groups                   | MembersOf                                     |
| admin                    | AdminStatus                                   |
| last\_login              | Last logon time                               |

## Troubleshooting

| Error message                                                    | Cause                                                                                    | Fix                                                                                            |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| LastPass Enterprise API rejected the request. Error: {error}     | The API answered with status FAIL during the connection test.                            | Check the company ID and the provisioning hash.                                                |
| No users returned by the LastPass Enterprise API. Error: {error} | The first page returned no users. A failed call still returns HTTP 200 with status FAIL. | Check the company ID, provisioning hash and the API settings in the Admin Console.             |
| LastPass returned page {n} again, stopping.                      | The API returned the same page twice, so paging stops.                                   | Run discovery again. If it repeats, check the user count.                                      |
| Status Code: `, followed by URL, Method and the response body`   | The API answered with a status other than 200. This is the shared REST connector error.  | Read the status code and body in the message, then check the credentials, permissions and URL. |

## Change history
