This is what the AppMap review skill posts on a pull request: the gold traces of base and
head compared, findings graded 🔴 high / 🟡 medium / 🟢 low, then the checks it ran. Everything it cites is in the
recordings behind the other tabs. traccar (Java): traccar/traccar#5801 · Fix OpenID administrator flag not syncing for existing users.
AppMap Behavioral Review: OpenID administrator flag synced for existing users (PR 5801)
Revisions: pr5801-head (b4a2743c6c, gold traces at 1a42d1f13) vs pr5801-base (5288bee04a, gold traces at 6a3edf652) · Date: 2026-09-21 ·
Commit: b4a2743c6c Fix OpenID administrator flag not syncing for existing users (#5801)
⚠️ How this review works. Twenty-eight JUnit tests were recorded on both revisions with the AppMap Java agent: the application code each reaches and the SQL it runs against the project's own schema on H2. Twenty come from the project's suite, one to three per subsystem. Eight were added at stage 5 of the protocol after the first comparison showed that no project test runs the login service, the OpenID provider or the storage layer against a database. The two sets were compared. Timing and data values are excluded. Two sources of noise are known and were read past: the storage layer's INSERT column order varies between JVM runs, and the probe's connection pool sends a keepalive
SELECT ?at a time that varies. The stage 5 probe asserts what the login must do to a stored user, not what either revision does, so three of its tests fail by design on BASE and one fails on HEAD. That one is the finding.
What the change does
A person logs in to traccar through an OpenID Connect provider. traccar reads the provider's
groups claim and, if openid.adminGroup names one of those groups, treats the person as an
administrator. Before this change that decision was applied once, when the user row was created,
and never again. The change writes the provider's name and administrator value back to the row on
every later login when either differs.
Summary
| Severity | Findings | Action required |
|---|---|---|
| 🔴 High | 1 · With no openid.adminGroup configured, every existing administrator is demoted on their next OpenID login (#1) |
fix before merge |
| 🟡 Medium | 0 | none |
| 🟢 Low | 1 · A provider that sends no groups claim crashes the callback with a NullPointerException when a group is configured (#2, existing on both revisions) | none before merge, see the 5861 case |
Merge blocking. The change does what the description says for servers that configure an admin group. For servers that do not, it turns a value the provider never had an opinion on into a write, and the write removes administrator rights. Upstream reached the same conclusion three weeks after merging, as issue 5829.
Findings
🔴 High
1 · An existing administrator loses the flag on OpenID login when no admin group is configured.
OpenIdProvider.handleCallbackcomputes the administrator value as a primitive:boolean administrator = adminGroup != null && userGroups.contains(adminGroup)(src/main/java/org/traccar/database/OpenIdProvider.java:177). With no admin group that isfalse. On BASELoginService.loginignored the value for an existing user. On HEAD the new branch compares it with the stored flag, findstrue != false, and writesfalseback (src/main/java/org/traccar/api/security/LoginService.java:135).OpenIdLoginProbeTest.withoutAnAdminGroupAnExistingAdministratorStaysAnAdministrator seeded: tc_users row, administrator = true. Config: no openid.adminGroup, no openid.allowGroup. base: OpenIdProvider#handleCallback -> LoginService#login(email, name, administrator = false) -> SELECT * FROM tc_users WHERE email = ? -> SessionHelper.userLogin -> INSERT INTO tc_actions (...) row read back: administrator = true passes head: OpenIdProvider#handleCallback -> LoginService#login(email, name, administrator = false) -> SELECT * FROM tc_users WHERE email = ? -> DatabaseStorage#updateObject -> UPDATE tc_users SET name = ?, administrator = ? WHERE id = ? -> SessionHelper.userLogin -> INSERT INTO tc_actions (...) row read back: administrator = false failsEvery server that uses OpenID for login and grants administrator rights by hand, which is what a server without
openid.adminGroupdoes, loses each administrator the next time they log in. Setting the flag back by hand lasts until the next login. The fix is to carry "no opinion" as a value: make the argument aBooleanthat isnullwhen no admin group is configured, and skip the comparison and the write when it is null. That is what upstream did in 9c31a03b3. The test that shows it is the one above.
🟢 Low
- 2 · A provider that omits the groups claim crashes the callback. When
openid.adminGrouporopenid.allowGroupis configured and the userinfo has nogroupsfield,userInfo.getStringListClaimreturns null anduserGroups.contains(...)throws aNullPointerExceptionout ofhandleCallback(src/main/java/org/traccar/database/OpenIdProvider.java:177). The recording ofaProviderThatSendsNoGroupsClaimIsRefusedWhenAnAllowGroupIsRequiredshows it on both revisions. Not caused by this change. It is the subject of the companion case for PR 5861, which fixes it.
Checks performed
| Check | Result | Note |
|---|---|---|
| Recorded behavior compared | ⚠️ 6 changed, 0 new, 0 removed of 28 | all six are stage 5 probe traces. The 20 project traces are unchanged |
| Behavior changed in code the PR did not touch | ✅ none | every added node is DatabaseStorage#updateObject and its UPDATE, reached from the changed branch |
| Intended changes confirmed by a recording | ✅ | promotion, demotion and rename of an existing user each add one UPDATE tc_users and the row read back has the new value |
| Unintended writes | 🔴 → #1 | the same UPDATE fires when no admin group is configured, with false |
| Database queries | ⚠️ 1 new statement | UPDATE tc_users SET name = ?, administrator = ? WHERE id = ?, in four traces, one of them #1 |
| Authorization | 🔴 → #1 | the administrator flag is the application's only authorization boundary between users and the whole server |
| Tests for the new behavior | ✅ after stage 5 · ❌ before it | the PR added no test. No project test runs the login service on either revision |
Review detail: features, coverage, drift
Feature List
- Write the provider's administrator value back to an existing user's row when it differs.
- Write the provider's name back when it differs.
- Keep the first-login path: create the row with the provider's values.
Coverage Matrix
| Feature | Covered by | Status |
|---|---|---|
| Existing user promoted by the provider | anExistingUserAddedToTheAdminGroupBecomesAnAdministrator (fails on base) |
✅ stage 5, and it is the drift |
| Existing administrator demoted by the provider | anExistingAdministratorRemovedFromTheAdminGroupIsDemoted (fails on base) |
✅ stage 5, and it is the drift |
| Existing user renamed by the provider | aRenamedUserGetsTheNewNameOnLogin (fails on base) |
✅ stage 5, and it is the drift |
| No admin group, existing administrator untouched | withoutAnAdminGroupAnExistingAdministratorStaysAnAdministrator (fails on head) |
🔴 → #1 |
| No admin group, existing plain user untouched | withoutAnAdminGroupAnExistingPlainUserStaysAPlainUser |
✅ unchanged outcome |
| First login creates the row with the flag | aFirstLoginFromTheAdminGroupCreatesAnAdministrator |
✅ unchanged |
| No groups claim, nothing required | aProviderThatSendsNoGroupsClaimStillLogsTheUserInWhenNoGroupIsRequired |
✅ unchanged |
| No groups claim, group required | aProviderThatSendsNoGroupsClaimIsRefusedWhenAnAllowGroupIsRequired (fails on both) |
🟢 → #2 |
| Everything else the application does | 20 project traces | ✅ unchanged |
Before stage 5 every row but the last was ❌: covers found no baseline running
LoginService#login, OpenIdProvider or DatabaseStorage#updateObject.
Behavioral Drift
Six traces changed, all from stage 5.
an existing user logs in through OpenID and the provider's name or flag differs
base: LoginService#login -> SELECT * FROM tc_users WHERE email = ? -> SessionHelper.userLogin
head: LoginService#login -> SELECT * FROM tc_users WHERE email = ?
-> DatabaseStorage#updateObject -> UPDATE tc_users SET name = ?, administrator = ? WHERE id = ?
-> SessionHelper.userLogin
This is the change, in the promotion, demotion and rename traces, and it is also #1 in the
no-admin-group trace, where the "differing" flag is a default and not the provider's opinion.
withoutAnAdminGroupAnExistingPlainUserStaysAPlainUser and
aProviderThatSendsNoGroupsClaimIsRefusedWhenAnAllowGroupIsRequired
Changed in digest only by the position of the connection pool's SELECT ? keepalive. No
application node differs. Noise.
Setup notes
Recorder. AppMap Java agent 1.30.1 through the com.appland.appmap Gradle plugin 1.2.0,
attached to the test task behind -Pappmap. Record command ./gradlew test -Pappmap -PappmapIgnoreTestFailures=true --console=plain --tests <Class.method>..., from framework: gradle. JAVA_HOME was Temurin 25.0.4.1, Gradle 9.3.1.
appmap.yml. org.traccar in full, with the decoder byte helpers, model plumbing, config key
plumbing and log formatter excluded. Labels on SecurityRequestFilter.filter,
LoginService.login, SessionHelper.userLogin (security.authentication), the permissions
service (security.authorization), SessionResource.remove (security.logout), the cache manager.
Database. H2 in memory through the project's own storage layer and Liquibase schema, the project's default engine.
Identity provider. A stand-in on 127.0.0.1 inside the test. Unsigned id token, any code accepted. The review is of what traccar does with the userinfo, which is where the change is.
Determinism. INSERT column order and the pool keepalive, both described above. The probe's
pool is closed in @AfterEach so that it does not write into other tests' recordings.
Invocation record.
node $SKILL/appmap-gold-traces/assets/manage.mjs update --record
node $SKILL/appmap-gold-traces/assets/manage.mjs covers --name 'LoginService#login'
node $SKILL/appmap-review/assets/review.mjs compare --base pr5801-base --head pr5801-head
Run in: the repository root of the traccar clone, on each branch in turn.
Repositories, commits, issue and pull request numbers are named. The people who wrote them are not.
Copyright 2026 Elizabeth Lawler. CC BY 4.0.
🔴 High: blocks the merge until answered. 🟡 Medium: a behaviour change the description does not state; call it out. 🟢 Low: a change worth a note. The finding here was introduced by this PR (novel, HEAD introduced it; upstream found it three weeks later as issue 5829).
🔴 High · OpenID login must not clear an existing user's administrator flag when openid.adminGroup is unset
If the server has not been told which single-sign-on group means 'administrator', then every existing administrator who signs in through single-sign-on is silently downgraded to a normal user on that login. The pull request meant to keep the admin flag in sync with the provider; it also made 'no group configured' count as 'not an admin' and wrote that back.