Skip to main content

Overview

Per-user sign-in (Connect AEM) needs one extra bundle on the AEM Author, gradial.obo. It adds three endpoints under /bin/gradial/obo/ and lets AEM accept a short-lived Gradial token as the person who connected. AEM then applies that person’s own permissions and records them as the user who made the change. This page is the AEM side. For the Gradial side, see Per-user AEM sign-in. Access: Must be enabled for your organization. Contact your Gradial team to get access. The bundle does not replace the Granite OAuth scopes in AEM 6.5 / LTS setup, and your existing connection keeps working.

How it ships

The release is gradial-65-oauth 1.3.0. It is also on Maven Central under the group io.github.gradial. Delegation does nothing until the OboService configuration exists with "enabled": true.

AEM 6.5 and LTS

1

Install the package

Download gradial.all-1.3.0.zip from the release and install it in Package Manager at /crx/packmgr on the Author. It is the same package as in AEM 6.5 / LTS setup, so if you already installed 1.3.0 there, skip this step.The package contains gradial.core (the Granite OAuth scopes), gradial.obo (installed to /apps/gradial-packages/obo/install.author, so Author only) and gradial.ui.config. gradial.ui.config ships the foundation configurations for per-user sign-in: the service user mapping, the repository initializer and the audit log.On every Author, the install creates the system users gradial-obo-state and gradial-oauth-scope-reader, their access control entries, and /var/gradial/obo, even while delegation stays off.
2

Add the OboService configuration

Add com.gradial.core.oauth.obo.OboService.cfg.json to your own project’s config.author folder, for example /apps/<project>/osgiconfig/config.author/, and deploy it the way you deploy your other configurations. Never put it under /apps/gradial, and don’t edit the files in /apps/gradial/osgiconfig by hand. See OboService configuration for the file.
Don’t add your own copy of the foundation configurations as well. The package already ships them. If two packages ship a file with the same name, the Sling installer applies only one of them, and it may be the older one.
If you deploy with Maven, the release notes give the same package as io.github.gradial:gradial.all:1.3.0:zip, embedded at /apps/vendor-packages/gradial/install.
Upgrading from 1.2.0 is safe and removes nothing under /apps/gradial. Do not roll back to 1.2.0 on an Author that has other content under /apps/gradial: the 1.2.0 package filters can delete it.

AEM as a Cloud Service

On AEM as a Cloud Service you don’t install gradial.all. Package Manager on Cloud can’t deploy Java bundles, so the bundle (io.github.gradial:gradial.obo:1.3.0 on Maven Central) and its configurations go in your own project and deploy through Cloud Manager.
Per-user sign-in refuses anyone whose effective AEM user, groups or principals include administrator membership, unless allowAdministrators is true. On AEM as a Cloud Service, check each person’s membership in AEM: an AEM Users product-profile assignment alone does not show they have none. Test with an account that is not an administrator.
1

Add the bundle to your project

In the pom.xml of your all container package, add the dependency:
In the same file, embed it in the filevault-package-maven-plugin configuration, in the Author-only install folder:
Replace <project> with the name your project already uses in its other <embedded> targets. The install.author folder keeps the bundle off Publish.
2

Add the two foundation configurations

In your ui.config module, add these files to /apps/<project>/osgiconfig/config.author/.org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~gradial-obo.cfg.json maps the bundle to its service user:
com.gradial.core.oauth.obo.OboRepositoryInitializer.cfg.json turns on the bundle’s repository initializer, which creates the service user and its folders when AEM starts. The file is empty on purpose:
3

Add the OboService configuration

Add com.gradial.core.oauth.obo.OboService.cfg.json with Cloud Manager variables in place of the values that change per environment:
publicOrigin differs for each environment. Put one copy of the file in each run mode folder, for example config.author.dev, config.author.stage and config.author.prod, each with that environment’s Author origin. See OboService configuration for each field.
4

Set the Cloud Manager variables

In Cloud Manager, add these environment variables to each environment, applied to the Author service:The variable names are examples. Use any names, as long as they match the configuration. While GRADIAL_OBO_ENABLED is not set, delegation stays off.
5

Deploy

Commit the changes and run your Cloud Manager pipeline. The bundle and the configurations reach the Author only.

OboService configuration

com.gradial.core.oauth.obo.OboService.cfg.json turns the feature on. The component stays inactive until this file exists, and nothing is delegated until enabled is true. It belongs in your own project’s config.author, never under /apps/gradial.
Leave allowAdministrators off. Delegation hands the connected person’s AEM permissions to Gradial, and for an administrator that bypasses every ACL. With it off, administrators can’t connect, and a grant held by someone who later becomes an administrator stops working on the next request.

Callback URLs

Callbacks must match exactly, and anything other than localhost, 127.0.0.1 and [::1] must use HTTPS.
  • Gradial production: https://app.gradial.com/api/integrations/aem-obo/callback
  • A dedicated Gradial host: https://<host>/api/integrations/aem-obo/callback
The Per-user AEM sign-in form in Gradial shows the callback URL to allow.

Create the client secret

Generate the secret from at least 32 random bytes. Keep the plain value for Gradial, and put only its hash in the configuration (on Cloud, in the Cloud Manager secret). Never use a person’s password.
The 64 hex characters at the start of the output are the value for clientSecretSha256. Store the plain $SECRET in your own secrets manager.

Enter the values in Gradial

In Gradial, open the AEM integration’s General settings. Under Per-user AEM sign-in, enter:
  • AEM sign-in origin: the same Author origin as publicOrigin.
  • OBO client ID: the clientId.
  • OBO client secret: the plain secret, not the hash.
Then select Enable per-user sign-in. See Per-user AEM sign-in.

What ends existing grants

  • Changing clientId or the client secret ends every grant. Use this as a kill switch.
  • Lowering grantSeconds shortens live grants. Raising it never extends one.
  • Changing redirectUris, publicOrigin or accessTokenSeconds does not end grants.

Audit log

The bundle writes events such as grant_issued, grant_revoked and consent_refused to the logger com.gradial.core.oauth.obo.audit. On AEM 6.5 and LTS, the package already sends them to logs/gradial-obo-audit.log.

Users and permissions

You do not grant jcr:impersonate to anyone and you do not create a mapping per person. The bundle’s login module validates each Gradial token and resolves the person’s own user and groups. What the person can do is exactly what their ACLs allow in AEM.
  • A person who is impersonating another user (a Sling sudo session) cannot connect.
  • The admin user and anyone with effective administrator membership are refused unless allowAdministrators is true.
  • A delegated token is refused with HTTP 403 on /bin/gradial/obo, /oauth, /libs/granite/oauth, /crx/packmgr, /crx/de, /crx/server, /libs/granite/security (except currentuser, whoami and userinfo) and /system/console.
  • Each person can hold at most ten active grants.
The repository initializer creates the system user gradial-obo-state under /home/users/system/gradial. It stores grants under /var/gradial/obo/grants and /var/gradial/obo/consents. It gives that user jcr:read,rep:write on /var/gradial/obo and read access to user and group nodes under /home/users and /home/groups, with rep:password denied. It has no content-write permission. everyone is denied read and write on /var/gradial/obo, and administrators keep access so they can inspect or delete grants.
If a regular user or group named gradial-obo-state already exists, the initializer changes nothing, logs one error, and per-user sign-in stays unavailable. Rename or remove that account first.

Network, dispatcher and proxies

The bundle exposes these Author endpoints. Allow all three through any proxy or dispatcher in front of the Author. Delegated requests carry the header Authorization: GradialOBO <token>, so do not strip it. Keep AEM’s CSRF protection on for the authorize page. If the Author blocks traffic by address, allowlist Gradial’s egress IPs.

Verify

  1. Open /system/console/bundles on the Author and search for gradial.obo. The bundle must be Active. Installed usually means the AEM is older than 6.5 SP8, or a dependency did not resolve. Check the bundle’s details in the console.
  2. Open /system/console/components and confirm com.gradial.core.oauth.obo.OboService is active. If it is unsatisfied, the OboService configuration is missing.
  3. Check that a system user with the ID gradial-obo-state exists under /home/users/system/gradial. AEM may give its node a generated name.
Then enter the values in Gradial and select Connect AEM. See Per-user AEM sign-in.

Troubleshooting

Remove it

Always remove the OboService configuration first. Every grant stops working at once.
  • AEM 6.5 and LTS: that is enough to turn per-user sign-in off. Keep gradial.all installed while any classic integration still uses its Granite scopes. Uninstall it only if nothing else needs it, and know that an uninstall can remove or revert the deployed scope files.
  • AEM as a Cloud Service: then remove the dependency, the <embedded> entry and the two foundation configurations from your project, and deploy.
The service user and the folders under /var/gradial/obo stay in the repository and do nothing. An administrator can delete them by hand.