AJ FHIR HAPI Plugin
v1.0.0 ยท Spring Boot 3.3 ยท HAPI FHIR 7.4 ยท Java 21 ยท Apache 2.0
A Spring Boot autoconfiguration plugin that pre-wires SMART discovery proxy and scope enforcement onto any HAPI FHIR JPA server. Drop the dependency in, set three properties, and your HAPI server speaks SMART App Launch v2.2.
GitHub: github.com/AKHester-Technologies/aj-smart-fhir-platform
What it doesโ
SMART Client HAPI FHIR JPA :8080 + Plugin Auth Server :9000
โ โ โ
โโโ GET /fhir/ โ โ
โ .well-known/ โ SmartDiscoveryProxyFilter โ
โ smart-configuration โโโ proxies to โโโโโโโโโโโโโโโโโโโบโ
โโโ SMART config โโโโโโโโโโโ response โโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโ GET /fhir/Patient/ โ โ
โ Authorization: Bearerโ SmartScopeAuthInterceptor โ
โ โ validates scope in token โ
โ โโโ checks patient/Patient.rs โ
โโโ 200 OK / 403 โโโ โโโโโโ โ
Componentsโ
| Class | Role |
|---|---|
SmartDiscoveryProxyFilter | OncePerRequestFilter โ proxies GET /fhir/.well-known/smart-configuration to the Auth Server |
SmartScopeAuthorizationInterceptor | HAPI SERVER_INCOMING_REQUEST_PRE_HANDLED interceptor โ validates SMART scopes against the Bearer token |
HapiFhirAutoConfiguration | @EnableAutoConfiguration entry point โ wires both components when smart.auth-server-url is set |
RemoteJwksConfig | RemoteJWKSet bean โ RS256 JWT validation with automatic key rotation |
Installationโ
<dependency>
<groupId>org.ajfhir</groupId>
<artifactId>aj-smart-fhir-platform</artifactId>
<version>1.0.0</version>
</dependency>
Configurationโ
smart:
auth-server-url: http://localhost:9000
fhir-base-url: http://localhost:8080/fhir
jwks-uri: http://localhost:9000/oauth2/jwks
That is the entire required configuration. The autoconfiguration registers both the proxy filter and the scope interceptor automatically.
Testsโ
12 tests covering autoconfiguration wiring, scope grant logic, JWKS public-key-only exposure, and RSA key generation.