cx-composer--for=liferay

OAuth Application (Headless Server)

Register a server-to-server OAuth application.

type: oAuthApplicationHeadlessServer·Configuration·Liferay docs →

# description

Provisions an OAuth 2.0 client suitable for machine-to-machine (server-to-server) calls into Liferay's headless APIs — the client credentials grant flow. Paired with `batch` and `siteInitializer` extensions that need Liferay API access on deploy. Grant only the scopes your workload needs (each Liferay Headless API defines its own scope alias — `Liferay.Headless.Admin.User.everything`, `Liferay.Headless.Batch.Engine.everything`, etc.). Bind the OAuth app to a user account via `userAccountEmailAddress` or `userAccountScreenName`, otherwise it defaults to the deployment user — check your Liferay docs for scope guidance.

Register OAuth apps and override Configuration Admin settings.

# when to use

  • You are shipping a Batch extension that imports data via the Headless Batch Engine.
  • A Site Initializer needs to provision content, structures, and roles via API.
  • You need a Liferay-provisioned OAuth client without clicking through admin UI.

# how to use

  1. 01Declare the extension with a stable identifier (used as the OAuth externalReferenceCode).
  2. 02Grant the scopes you need (Liferay.Headless.Admin.Site.everything, etc.).
  3. 03Reference this extension by name from a sibling batch or siteInitializer extension.

# optional fields

fieldtypedescription
namestringApplication profile name.
descriptionstringDescription.
homePageURLstringBase URL. Defaults to the DXP main domain.
privacyPolicyURLstringPrivacy policy URL.
scopesstring[]OAuth scopes granted to the app.
userAccountEmailAddressstringEmail of the user account bound to this OAuth app.
userAccountScreenNamestringScreen name (overrides email if both set).

# example

client-extension.yaml
my-oauth-headless:
    type: oAuthApplicationHeadlessServer
    name: Batch Loader
    scopes:
        - Liferay.Headless.Admin.User.everything
        - Liferay.Headless.Batch.Engine.everything

# more in configuration