# \_auth\_PLEX

Plex authentication provider (PIN / device flow).

{% tabs %}
{% tab title="End users" %}

### What this auth provider does

Connects CrossWatch to a Plex account using a Plex PIN.

CrossWatch stores the Plex token, not your password.

### Auth flow

* `device_pin`

### Writes to config

Namespace:

* `cfg["plex"]`

Common fields:

* `account_token`
* server/account identifiers (UI-dependent)

### Related docs

* UI setup: [Auth: Plex](/crosswatch/providers/authentication/auth-media-servers/auth-plex.md)
* Adapter: [Adapter: PLEX](/crosswatch/providers/synchronization/adapter-plex.md)
* Sync module: [PLEX module](/blueprint-architecture/sync/_mod_plex.md)

### Gotchas

* Popup blockers can prevent the Plex tab from opening.
* PMS URLs must be reachable from the container.
  {% endtab %}

{% tab title="Power users" %}

### Code map

* `providers/auth/_auth_PLEX.py`

### Public surface

* class: `PlexAuth`
* functions: `log()`, `html()`

### External endpoints

* `https://plex.tv/api/v2/pins`
* `https://plex.tv/pin`

### Capabilities

<details>

<summary>Capabilities (raw)</summary>

```json
{
  "features": {
    "watchlist": {
      "read": true,
      "write": true
    },
    "collections": {
      "read": true,
      "write": false
    },
    "ratings": {
      "read": true,
      "write": true,
      "scale": "1-10"
    },
    "watched": {
      "read": true,
      "write": true
    },
    "liked_lists": {
      "read": false,
      "write": false
    }
  },
  "entity_types": [
    "movie",
    "show"
  ]
}
```

</details>

### Dependencies

* `cw_platform.config_base.save_config`
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.crosswatch.app/blueprint-architecture/auth/_auth_plex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
