• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

medplum / medplum / 21882282798
92%
main: 92%

Build:
Build:
LAST BUILD BRANCH: ml-search-params
DEFAULT BRANCH: main
Ran 10 Feb 2026 09:10PM UTC
Jobs 1
Files 722
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Feb 2026 09:01PM UTC coverage: 92.303% (+0.001%) from 92.302%
21882282798

push

github

web-flow
feat(server): support sub claim fallback in external auth (#8392)

* feat(server): support sub claim fallback in external auth

When no fhirUser claim is present in an external JWT, fall back to using
the standard sub (subject) claim to look up a ProjectMembership by its
externalId field. This enables external IDPs that don't support
SMART-on-FHIR claims to authenticate users directly.

Key changes:
- tryExternalAuthLogin now checks for sub when fhirUser is absent
- Searches ProjectMembership by external-id matching the sub claim
- Returns 401 if multiple memberships share the same externalId
- fhirUser always takes precedence when both claims are present
- Token validation via userinfo endpoint applies to both paths

Closes #8391

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Rahul Agarwal <rahul@medplum.com>

* [autofix.ci] apply automated fixes

* fix(server): use unique nonces in external auth tests to avoid cache hits

Tests using the same sub claim were hitting the Redis cache from prior
tests, causing false positives/negatives. Adding unique nonces ensures
each test JWT produces a distinct cache key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Rahul Agarwal <rahul@medplum.com>

* Address review feedback: test, comment, and docs improvements

- Add test for ext.fhirUser claim (fhirUser inside ext block)
- Add comment explaining count: 2 optimization for duplicate detection
- Clarify variable substitution in curl example in docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Rahul Agarwal <rahul@medplum.com>

* docs: add self-hosted only admonition to direct external auth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Rahul Agarwal <rahul@medplum.com>

* docs: expand externalAuthProviders in server config docs

Add property table, example config, and link to direct external auth
docs page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>... (continued)

17003 of 19277 branches covered (88.2%)

Branch coverage included in aggregate %.

20 of 20 new or added lines in 1 file covered. (100.0%)

31059 of 32793 relevant lines covered (94.71%)

13831.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 21882282798.1 10 Feb 2026 09:10PM UTC 722
92.3
GitHub Action Run
Source Files on build 21882282798
  • Tree
  • List 722
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 74fdefbb on github
  • Prev Build on gh-readonly-queue/main/pr-8397-2b2ef0e5e2bb8bd57f3c8f1e3674bd5131123897 (#21881840227)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc