Skip to main content
Version: Next

Client Protocol

Direct Edit serves one desktop client per install. The setting pimcore_direct_edit.client_protocol selects it:

ValueClientHow the client authenticates
1Pimcore Direct Edit ClassicThe edit link's token, as up to 2026.3.
2Pimcore Direct EditPimcore OAuth: the editor approves the client once per Pimcore host in the browser.

The default is 2. Which Client? says where to get each one; both come from the same release page and can be installed side by side. There is no mixed mode: the client of the other protocol gets an answer that tells its editor to install the right app (see Wrong client).

# config/packages/pimcore_direct_edit.yaml
pimcore_direct_edit:
client_protocol: 2
# Optional, see the table below.
#client_download_url: 'https://intranet.example.com/software/pimcore-direct-edit'
#min_client_version: '1.0.0'
SettingDefaultDescription
client_protocol21 = Pimcore Direct Edit Classic, 2 = Pimcore Direct Edit with Pimcore OAuth.
client_download_urlthe client docs page, at the installers of the active protocol's client (https://docs.pimcore.com/platform/Direct_Edit/Pimcore_Direct_Edit_Client/#pimcore-direct-edit for protocol 2, …#pimcore-direct-edit-classic for protocol 1)Where editors get the client of the active protocol. When set, it is used for either protocol. Clients show it as a download button, so use https.
min_client_version0.2.1 for protocol 1, 1.0.0 for protocol 2Oldest client version of the active protocol that the server works with. Older protocol 2 clients are asked to update.
caution

Protocol 2 is the default from this release on. An install that has not enabled Pimcore's OAuth server fails to boot after the upgrade, with a message naming what is missing. To keep Pimcore Direct Edit Classic, set client_protocol: 1 before upgrading; nothing else changes for its editors.

Portal and Custom Applications​

With client_protocol: 2, sessions started in Pimcore Studio use Pimcore OAuth. Sessions started in the Portal Engine or in a custom application have no Pimcore OAuth identity, so their link carries a grant instead and the new client needs no browser login for them:

  1. The link is pimcore-direct-edit://open?host=…&session=…&grant=…. The grant is random, for single use, valid for 60 seconds, and stored in the database only as its hash.
  2. The client exchanges it once with POST /pimcore_direct_edit/v2/sessions/{id}/grant ({"grant": "…"}) for a session token that is valid for 15 minutes and stored only as its hash.
  3. The client downloads and uploads with the session token as bearer. It opens this session only, and only GET …/file and PUT …/file.
  4. Before the token runs out the client calls POST /pimcore_direct_edit/v2/sessions/{id}/renew with the token and gets a new one; renewals end with the session.

A grant that is exchanged twice answers 401 grant_used and withdraws the session's token; one older than 60 seconds answers 401 grant_expired. Both are part of contract 2.3.0, with examples. The editor opens the file again from the host to get a new link.

What the host does: it implements OwnerPermissionServiceInterface (see Integrate into Custom Application), so that the bundle can ask it whether an owner may still edit an asset and which Pimcore user authors a saved version. A host without that service keeps serving protocol 1 only: with client_protocol: 2 its sessions are refused. Rights are asked on download, upload and renewal, at most once per 60 seconds and session.

The claims (single use, 60 seconds, revocation, scope) and the test that proves each are in SECURITY.md.

Requirements of Protocol 2​

With client_protocol: 2 the container refuses to build, naming the missing prerequisite, unless:

  • pimcore/studio-backend-bundle 2026.3 or later is installed, the first release with the OAuth server;
  • the OAuth server is enabled (pimcore_studio_backend.oauth.enabled: true).

Protocol 1 needs neither.

Move an Install to Protocol 2​

Do the steps in this order. Until the last one, editors keep working with Pimcore Direct Edit Classic.

  1. Keep protocol 1 while you prepare. If you upgrade before the other steps are done, set client_protocol: 1 first.

  2. Enable OAuth. Pimcore's OAuth server is part of Studio backend and off by default. Enable it with an issuer and keys as described in Studio backend's OAuth 2.1 Authorization Server documentation:

    # config/packages/pimcore_studio_backend.yaml
    pimcore_studio_backend:
    oauth:
    enabled: true
    issuer: '%env(OAUTH_ISSUER)%' # e.g. https://pimcore.example.com, the origin editors use
    keys:
    private_key: '%env(OAUTH_PRIVATE_KEY)%'
    public_key: '%env(OAUTH_PUBLIC_KEY)%'
    encryption_key: '%env(OAUTH_ENCRYPTION_KEY)%'

    Pimcore has to be served from the root of the issuer's origin. Direct Edit registers its own protected resource, <issuer>/pimcore_direct_edit with the scope direct-edit:edit; you do not add it under resources.

  3. Register the client. The new client is a public client with the id pimcore-direct-edit. It receives the authorization on a loopback redirect, on a port it picks at each login:

    pimcore_studio_backend:
    oauth:
    clients:
    pimcore-direct-edit:
    name: 'Pimcore Direct Edit'
    redirect_uris:
    - 'http://127.0.0.1/callback'
  4. Set a shorter refresh-token lifetime (recommended). The client stays logged in with its refresh token, by default for 30 days. A shorter lifetime limits how long a lost or shared machine can still edit; editors then approve the client again in the browser when it has run out. The lifetime applies to every OAuth client of the install, for example 7 days:

    pimcore_studio_backend:
    oauth:
    refresh_token_ttl: 604800

    Removing the user's pimcore_direct_edit permission, or deactivating the user, stops editing at once, whatever the lifetime.

  5. Roll out Pimcore Direct Edit to every editor's machine, from client_download_url, before you switch.

  6. Switch with client_protocol: 2 and clear the cache. From now on, the calls of Pimcore Direct Edit Classic are answered with wrong_client: it can no longer download or upload. Ask editors to upload their open files before the switch.

To go back, set client_protocol: 1 and clear the cache. The OAuth configuration can stay.

Capabilities​

A client asks the server which protocol it speaks before it calls anything else. The endpoint is public and carries no secrets:

GET /pimcore_direct_edit/capabilities
{
"protocol": 2,
"contract": "2.0",
"bundleVersion": "2026.4.0",
"minClientVersion": "1.0.0",
"oauth": {
"issuer": "https://pimcore.example.com",
"resource": "https://pimcore.example.com/pimcore_direct_edit",
"scope": "direct-edit:edit"
}
}

oauth is null on protocol 1.

Locked Assets and Upload Size​

On protocol 2, GET /pimcore_direct_edit/v2/sessions/{id}, GET …/file and PUT …/file answer 423 Locked while the asset is locked in Pimcore (itself or through a parent folder):

{
"error": "asset_locked",
"message": "This asset is locked in Pimcore and can't be edited."
}

PUT …/file answers 413 Content Too Large when the file is larger than max_upload_size; nothing is stored:

{
"error": "upload_too_large",
"message": "The file is larger than this Pimcore accepts (100 MB)."
}

Both are part of contract 2.1.0. A client that doesn't know them shows the message. Protocol 1 refuses the same cases with success: false and the same message. See Locked Assets and Upload Size.

Wrong Client​

The endpoints of the inactive protocol answer 409 Conflict. On protocol 2 these are the endpoints of Pimcore Direct Edit Classic (/pimcore_direct_edit/downloadFile, uploadFile, reNotifyBrowser, askActivity); on protocol 1 every path under /pimcore_direct_edit/v2/:

{
"error": "wrong_client",
"protocol": 2,
"downloadUrl": "https://docs.pimcore.com/platform/Direct_Edit/Pimcore_Direct_Edit_Client/#pimcore-direct-edit",
"message": "This Pimcore now works with Pimcore Direct Edit. Please install Pimcore Direct Edit, then open the file again from Pimcore."
}

protocol is the active protocol. message is in the language of the request's Accept-Language header (English, German, Spanish, French, Italian, Dutch, Norwegian, Polish or Swedish; English otherwise). The texts are in the translation domain pimcore_direct_edit_protocol and can be overridden like any Symfony translation.

Versions of Pimcore Direct Edit Classic released before this change do not know this answer and report a failed download or upload.